Add Bookmark

VSTO Words

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");

Download

Last edited Feb 4, 2014 at 4:48 AM by asposemarketplace, version 2