This documentation is archived and is not being maintained.

NextBookmark Method (General Extensibility)

Visual Studio .NET 2003

Moves to the location of the next bookmark in the document.

[Visual Basic .NET]
Public Function NextBookmark() As Boolean
[Visual Basic 6]
Function NextBookmark() As Boolean
[C++]
HRESULT __stdcall NextBookmark(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
[C#]
bool NextBookmark();
[JScript .NET]
public function NextBookmark() : Boolean

Return Value

Returns True if the insertion point moves to the next bookmark, False if otherwise.

Remarks

The TextSelection or EditPoint is moved to the new location. If there are no more bookmarks, no movement occurs.

Example

Sub NextBookmarkExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   'Create a new text file.
   Call DTE.ItemOperations.NewFile("General\Text File")
       
   'Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   'Insert ten lines of text.
   For iCtr = 1 To 10
     objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
       
   objEditPt.StartOfDocument()
   'Set some bookmarks.
   objEditPt.LineDown(1)
   'Set the first bookmark.
   objEditPt.SetBookmark()
   'Set the second bookmark on the next line.
   objEditPt.LineDown(1)
   objEditPt.SetBookmark()
   'Go back to the first bookmark.
   objEditPt.PreviousBookmark()
   'Plug in some text there.
   objEditPt.Insert("BOOKMARK 1: ")
   'Do the same thing at the next bookmark.
   objEditPt.NextBookmark()
   objEditPt.Insert("BOOKMARK 2: ")
End Sub

See Also

Applies To: EditPoint Object | TextSelection Object

Show: