Maximize productivity with
30% off* for a limited time
using BOOSTDEV30.
Includes 3- and 5-packs.
*Some exclusions may apply.New Product LaunchBoldDesk: Help desk ticketing software starts at $10 for 3 agents.
Try it for free.
//Loads existing Word document.
WordDocument document = new WordDocument("Template.docx");
WParagraph paragraph = document.LastParagraph;
//Get the picture in the Word document.
WPicture picture = paragraph.ChildEntities[1] as WPicture;
//Set width for picture.
picture.Width = 200;
//Set height scale based on the width scale factor.
picture.HeightScale = picture.WidthScale;
//Saves and closes the document instance
document.Save("Result.docx");
document.Close();
|
//Loads existing Word document.
WordDocument document = new WordDocument("Template.docx");
WParagraph paragraph = document.LastParagraph;
//Get the picture in the Word document.
WPicture picture = paragraph.ChildEntities[1] as WPicture;
//Set height for picture.
picture.Height = 300;
//Set width scale based on the height scale factor.
picture.WidthScale = picture.HeightScale;
//Saves and closes the document instance
document.Save("Result.docx");
document.Close(); |