We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Inserting bookmarks without using Document Builder

Can you porivde some code snippets for inserting bookmarks without using Document Builder.

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Here is simple code, which shows how to achieve this:

// Create document.

Document doc = new Document();

// Create bookmarks start and bookmark end.

BookmarkStart start = new BookmarkStart(doc, "bybk");

BookmarkEnd end = new BookmarkEnd(doc, "bybk");

// Insert stat and end of bookmark into the document.

doc.FirstSection.Body.FirstParagraph.AppendChild(start);

doc.FirstSection.Body.FirstParagraph.AppendChild(end);

// Save output document.

doc.Save(@"Test001\out.doc");

Hope this helps.

Best regards.