Op Englesch liesen

Deelen iwwer


EditPoint.PreviousBookmark Method

Definition

Moves the edit point to the location of the previous bookmark in the document.

C++/CX
public:
 bool PreviousBookmark();

Returns

A Boolean value indicating true if the edit point moves to a previous bookmark, false if not.

Attributes

Examples

VB
Sub PreviousBookmarkExample(ByVal dte As DTE2)  

    ' Create a new text document.  
    dte.ItemOperations.NewFile()  

    ' Create an EditPoint at the start of the new document.  
    Dim doc As TextDocument = _  
        CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)  
    Dim point As EditPoint = doc.StartPoint.CreateEditPoint  
    Dim i As Integer  

    ' Insert ten lines of text.  
    For i = 1 To 10  
        point.Insert("This is a test." & vbCrLf)  
    Next  

    point.StartOfDocument()  

    ' Set a bookmark on each of the first two lines.  
    point.SetBookmark()  
    point.LineDown(1)  
    point.SetBookmark()  

    ' Insert text at each bookmark and then clear each bookmark.  
    point.PreviousBookmark()  
    point.Insert("BOOKMARK 1: ")  
    point.ClearBookmark()  
    point.NextBookmark()  
    point.Insert("BOOKMARK 2: ")  
    point.ClearBookmark()  

End Sub  

Remarks

If there are no more bookmarks, the edit point is not moved.

PreviousBookmark moves the EditPoint object to the location of the first bookmark preceding the location of the active end of the EditPoint. The EditPoint is collapsed at the new location.

Applies to

Produkt Versiounen
Visual Studio SDK 2015, 2017, 2019, 2022