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.9
Syntax
public class BookmarkStart : Node

The BookmarkStart type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleBookmarkStart
Initializes a new instance of the BookmarkStart class.
Properties
  NameDescription
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.)
Methods
  NameDescription
Public methodCode exampleAccept
Accepts a visitor.
(Overrides NodeAccept(DocumentVisitor).)
Public methodCode exampleClone (Inherited from Node.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetAncestor(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
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodCode exampleGetText
Returns an empty string.
(Overrides NodeGetText.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodCode exampleNextPreOrder
Gets next node according to the pre-order tree traversal algorithm.
(Inherited from Node.)
Public methodPreviousPreOrder
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
Returns a string that represents the current object.
(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.)
Remarks

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.

Examples
Shows how to create a bookmark by inserting bookmark start and end nodes.
[C#]

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