TextDocument.ClearBookmarks Methode

Definition

Entfernt alle unbenannten Lesezeichen im Textdokument.

public:
 void ClearBookmarks();
public:
 void ClearBookmarks();
void ClearBookmarks();
[System.Runtime.InteropServices.DispId(122)]
public void ClearBookmarks ();
[<System.Runtime.InteropServices.DispId(122)>]
abstract member ClearBookmarks : unit -> unit
Public Sub ClearBookmarks ()
Attribute

Beispiele

Sub ClearBookmarksExample(ByVal dte As EnvDTE.DTE)  
    Dim objTD As TextDocument  

    objTD = dte.ActiveDocument.Object  
    MsgBox("Selection: " & objTD.Selection.Mode.ToString)  
    If Not objTD.MarkText("int") Then  
        MsgBox("""int"" not found.")  
    Else  
        MsgBox("Note that unnamed bookmarks have been placed on lines _  
        containing ""int"".")  
        objTD.ClearBookmarks()  
    End If  
End Sub  
public void ClearBookmarksExample(_DTE dte)  
{  
    TextDocument td;  

    td = (TextDocument)dte.ActiveDocument.Object("");  
    MessageBox.Show ("Selection: " + td.Selection.Mode.ToString ());  
    if (td.MarkText ("int", (int)vsFindOptions.vsFindOptionsNone) ==   
    false)  
        MessageBox.Show ("\"int\" not found.");  
    else  
    {  
        MessageBox.Show ("Note that unnamed bookmarks have been placed   
        on lines containing \"int\".");  
        td.ClearBookmarks ();  
    }  
}  

Hinweise

In den folgenden Beispielen wird ein Dokument (z. b. eine Textdatei) für das Wort int angezeigt. Wenn Sie gefunden wird, wird ein Lesezeichen in seine Zeile eingefügt. In den Beispielen wird die- ClearBookmarks Methode verwendet, um die Lesezeichen zu löschen.

Um das folgende Beispiel auszuführen, erstellen oder öffnen Sie zunächst ein Dokument, das das Wort int enthält.

Gilt für