Wednesday, 06 April 2011 09:13

PDF Bookmark in C#, VB.NET

The sample demonstrates how to work with bookmark in PDF document.

Download Bookmark.pdf

Published in Interaction
Tuesday, 28 December 2010 02:25

Insert Word Bookmark in C#, VB.NET

Word bookmark is convenient for users to go to specified location and modify contents of bookmark range in a document. Solution in this guide introduces how to insert bookmark in existing Word document in C# and VB.NET via Spire.Doc for .NET. In this example, the bookmark range is from the end of the fourth paragraph to the end of the fifth paragraph. The following screenshot presents effect after Work bookmark inserting.

Insert Word Bookmark

Spire.Doc for .NET, a professional .NET Word component, provides two methods to insert Word bookmark, Paragraph.AppendBookmarkStart and Paragraph.AppendBookmarkEnd with parameter string name. The former method is used to append start of the bookmark with specified name into paragraph, while the later to append end of bookmark. Download and install Spire.Doc for .NET and follow the code to insert Word bookmark.

using System;
using Spire.Doc;
using Spire.Doc.Documents;

namespace WordBookmark
    class Bookmark
        static void Main(string[] args)
            //Load Document
            Document document = new Document();
            document.LoadFromFile(@"E:\Work\Document\.NET Framework.docx");

            //Insert Bookmark
            Section section = document.Sections[0];

            //Save and Launch 
            document.SaveToFile("Bookmark.docx", FileFormat.Docx);
Imports System
Imports Spire.Doc
Imports Spire.Doc.Documents

Namespace WordBookmark
    Friend Class Bookmark
        Shared Sub Main(ByVal args() As String)
            'Load Document
            Dim document As New Document()
            document.LoadFromFile("E:\Work\Document\.NET Framework.docx")

            'Insert Bookmark
            Dim section As Section = document.Sections(0)

            'Save and Launch 
            document.SaveToFile("Bookmark.docx", FileFormat.Docx)
        End Sub
    End Class
End Namespace

Spire.Doc, an easy-to-use component to operate Word document, allows developers to fast generate, write, edit and save Word (Word 97-2003, Word 2007, Word 2010) in C# and VB.NET for .NET, Silverlight and WPF.

Published in Bookmark
Wednesday, 21 July 2010 09:00

Word Bookmark in C#, VB.NET

The sample demonstrates how to Set bookmark in Word document.

Published in Context