DocumentBuilderMoveToBookmark Method (String, Boolean, Boolean)
Moves the cursor to a bookmark with greater precision.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.10
Syntax
public bool MoveToBookmark(
	string bookmarkName,
	bool isStart,
	bool isAfter
)

Parameters

bookmarkName
Type: SystemString
The name of the bookmark to move the cursor to.
isStart
Type: SystemBoolean
When true, moves the cursor to the beginning of the bookmark. When false, moves the cursor to the end of the bookmark.
isAfter
Type: SystemBoolean
When true, moves the cursor to be after the bookmark start or end position. When false, moves the cursor to be before the bookmark start or end position.

Return Value

Type: Boolean
True if the bookmark was found; false otherwise.
Remarks

Moves the cursor to a position before or after the bookmark start or end.

If desired position is not at inline level, moves to the next paragraph.

The comparison is not case-sensitive. If the bookmark was not found, false is returned and the cursor is not moved.

Examples
Shows how to move a cursor position to just after the bookmark end.
[C#]

Document doc = new Document(MyDir + "DocumentBuilder.doc");
DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToBookmark("CoolBookmark", false, true);
builder.Writeln("This is a very cool bookmark.");
See Also