Using Bookmarks

A bookmark is a part of a document that has been assigned a name. A bookmark can contain no document content, in which case it serves only to mark a location in the document. A bookmark can also contain text. In many ways a bookmark is like a range except that it is saved with the document and can be referred to by name. As you would expect, each bookmark in a document is represented by a Bookmark object, and each document has a Bookmarks collection containing all of its bookmarks.

To create a new bookmark, use the Bookmarks collection's Add method:

ActiveDocument.Bookmarks.Add(Name, Range)

The Name argument specifies the bookmark name, and Range is a Range object that identifies the bookmark location (the Range object is covered ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.