Add Bookmark
Contents
[
Hide
]
VSTO
Word.Application wordApp = Application;
wordApp.Documents.Open("Add Bookmark.doc");
Document extendedDocument = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
Bookmark firstParagraph = extendedDocument.Controls.AddBookmark(
extendedDocument.Paragraphs[1].Range, "FirstParagraph");
Aspose.Words
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.StartBookmark("MyBookmark");
builder.Writeln("Text inside a bookmark.");
builder.EndBookmark("MyBookmark");
doc.Save("Adding Bookmark.doc");