Free Support Forum - aspose.com

Removing an image after a bookmark

Is it possible to remove an image in a document using Aspose.Word, how would I locate and delete that image if for example the image is directly after a bookmark?

If the image will immediately follow bookmark you can use the following code to remove it:

Bookmark bookmark = doc.Range.Bookmarks["bookmark1"];

bookmark.BookmarkEnd.NextSibling.Remove();