BookmarkStart Class
Represents a start of a bookmark in a Word document.
Inheritance Hierarchy

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
public class BookmarkStart : Node

The BookmarkStart type exposes the following members.

Public methodCode exampleBookmarkStart
Initializes a new instance of the BookmarkStart class.
Public propertyCode exampleBookmark
Gets the facade object that encapsulates this bookmark start and end.
Public propertyCode exampleDocument
Gets the document to which this node belongs.
(Inherited from Node.)
Public propertyCode exampleIsComposite
Returns true if this node can contain other nodes.
(Inherited from Node.)
Public propertyCode exampleName
Gets or sets the bookmark name.
Public propertyCode exampleNextSibling
Gets the node immediately following this node.
(Inherited from Node.)
Public propertyCode exampleNodeType
Returns BookmarkStart.
(Overrides NodeNodeType.)
Public propertyCode exampleParentNode
Gets the immediate parent of this node.
(Inherited from Node.)
Public propertyCode examplePreviousSibling
Gets the node immediately preceding this node.
(Inherited from Node.)
Public propertyCode exampleRange
Returns a Range object that represents the portion of a document that is contained in this node.
(Inherited from Node.)
Public methodCode exampleAccept
Accepts a visitor.
(Overrides NodeAccept(DocumentVisitor).)
Public methodCode exampleClone (Inherited from Node.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodCode exampleGetAncestor(Type)
Gets the first ancestor of the specified object type.
(Inherited from Node.)
Public methodCode exampleGetAncestor(NodeType)
Gets the first ancestor of the specified NodeType.
(Inherited from Node.)
Public methodGetHashCode (Inherited from Object.)
Public methodCode exampleGetText
Returns an empty string.
(Overrides NodeGetText.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodCode exampleNextPreOrder
Gets next node according to the pre-order tree traversal algorithm.
(Inherited from Node.)
Public methodCode examplePreviousPreOrder
Gets the previous node according to the pre-order tree traversal algorithm.
(Inherited from Node.)
Public methodCode exampleRemove
Removes itself from the parent.
(Inherited from Node.)
Public methodToString (Inherited from Object.)
Public methodCode exampleToString(SaveFormat)
Exports the content of the node into a string in the specified format.
(Inherited from Node.)
Public methodCode exampleToString(SaveOptions)
Exports the content of the node into a string using the specified save options.
(Inherited from Node.)

A complete bookmark in a Word document consists of a BookmarkStart and a matching BookmarkEnd with the same bookmark name.

BookmarkStart and BookmarkEnd are just markers inside a document that specify where the bookmark starts and ends.

Use the Bookmark class as a "facade" to work with a bookmark as a single object.

Shows how to create a bookmark by inserting bookmark start and end nodes.
Document doc = new Document();

// An empty document has just one empty paragraph by default.
Paragraph p = doc.FirstSection.Body.FirstParagraph;

p.AppendChild(new Run(doc, "Text before bookmark."));

p.AppendChild(new BookmarkStart(doc, "My bookmark"));
p.AppendChild(new Run(doc, "Text inside bookmark."));
p.AppendChild(new BookmarkEnd(doc, "My bookmark"));

p.AppendChild(new Run(doc, "Text after bookmark."));

doc.Save(ArtifactsDir + "Bookmarks.CreateBookmarkWithNodes.doc");
See Also