Open BenLampson opened 1 year ago
Hi, With the Latest version of DocX (v2.5), you can do it this way: // Load a document. using( var document = DocX.Load( "ReplaceTextWithObjects.docx" ) ) { // Create the image from disk and set its size. var image = document.AddImage( "2018.jpg" ); var picture = image.CreatePicture( 175f, 325f );
// Do the replacement of all the found tags with the specified image and ignore the case when searching for the tags.
document.ReplaceTextWithObject( new ObjectReplaceTextOptions() { SearchValue = "
// Save this document to disk. document.SaveAs( "ReplacedTextWithObjects.docx" ); }
Thanks
Nothing changed.