BookmarkCollection Class
A collection of Bookmark objects that represent the bookmarks in the specified range.
Inheritance Hierarchy

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.9
public class BookmarkCollection : IEnumerable<Bookmark>, 

The BookmarkCollection type exposes the following members.

Public methodCode exampleClear
Removes all bookmarks from this collection and from the document.
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 methodCode exampleGetEnumerator
Returns an enumerator object.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
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 exampleRemove(String)
Removes a bookmark with the specified name.
Public methodCode exampleRemove(Bookmark)
Removes the specified bookmark from the document.
Public methodCode exampleRemoveAt
Removes a bookmark at the specified index.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Shows how to obtain bookmarks from a bookmark collection.

Document doc = new Document(MyDir + "Bookmarks.doc");

// By index.
Bookmark bookmark1 = doc.Range.Bookmarks[0];

// By name.
Bookmark bookmark2 = doc.Range.Bookmarks["Bookmark2"];
See Also