Bookmark.MoveStart Method (Object, Object)


Moves the start position of the Bookmark control.

Namespace:   Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

int MoveStart(
	ref object unit,
	ref object count


Type: System.Object

T:Microsoft.Office.Interop.Word.WdUnits. The unit by which start position of the specified range or selection is to be moved.

Type: System.Object

The maximum number of units by which the Bookmark control is to be moved. If Count is a positive number, the start position of the Bookmark control is moved forward in the document. If it is a negative number, the start position is moved backward. If the start position is moved forward to a position beyond the end position, the Bookmark control is collapsed and both the start and end positions are moved together. The default value is 1.

Return Value

Type: System.Int32

The number of units by which the start position of the Bookmark control actually moved, or it returns 0 (zero) if the move was unsuccessful.

For information on optional parameters, see Optional Parameters in Office Solutions.

The following code example adds a Bookmark control with text to the first paragraph and then moves the start position of the bookmark.

This example is for a document-level customization.

private void BookmarkMoveStart()
    this.Paragraphs[1].Range.Text = "This is sample text.";
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =

    object Unit = Word.WdUnits.wdCharacter;
    object Count = 3;

    bookmark1.MoveStart(ref Unit, ref Count);

Return to top