I have followed your article that describes how to insert an image at a book mark and I have that working.
"How-to-insert-an-image-at-bookmark-in-word-documents.html"
What I want to do is replace the book mark with the image. I have the bookmark inside a boarder and if I add the image after the bookmark it appears outside the boarder.
This is what I have from the example
- Code: Select all
bookmarkNavigator.MoveToBookmark(Properties.Settings.Default.BookMark1);
Image image = Image.FromFile(textBoxImageFileName.Text);
//Add a section and name it section0
Section section0 = document.AddSection();
//Add a paragraph for section0
Paragraph paragraph = section0.AddParagraph();
//Add a picture into paragraph
DocPicture picture = paragraph.AppendPicture(image);
//Add paragraph into docuemnt
bookmarkNavigator.InsertParagraph(paragraph);
// Remove Section0
document.Sections.Remove(section0);
To replace the bookmark with text is quite simple
- Code: Select all
bookmarkNavigator.MoveToBookmark(Properties.Settings.Default.BookMark2);
bookmarkNavigator.ReplaceBookmarkContent(textBoxSPNumber.Text, true);
How Can I replace the bookmark with an image or other wise get my image to land inside the boarder?
Thanks
David