Export (0) Print
Expand All
Cut
Run
Expand Minimize

ClearBookmark Method (General Extensibility)

Visual Studio .NET 2003

Clears any unnamed bookmarks in the current text buffer line.

[Visual Basic .NET]
Public Sub ClearBookmark() 
[Visual Basic 6]
Sub ClearBookmark() 
[C++]
HRESULT __stdcall ClearBookmark();
[C#]
void ClearBookmark();
[JScript .NET]
public function ClearBookmark()

Example

Sub ClearBookmarkExample()
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: ")
        
   msgbox("Bookmark exists.")
   objeditpt.ClearBookmark()
   msgbox("Bookmark erased.")
End Sub

See Also

Applies To: EditPoint Object | TextSelection Object

Show:
© 2014 Microsoft