Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
Gets a Microsoft.Office.Interop.Word.Bookmarks collection that represents all the bookmarks in the document.
Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public ReadOnly Property Bookmarks As Bookmarks
    Get
public Bookmarks Bookmarks { get; }
Property Value
Type: Microsoft.Office.Interop.Word.Bookmarks
A Microsoft.Office.Interop.Word.Bookmarks collection that represents all the bookmarks in the document.
Examples
The following code example adds a Bookmark control to the first paragraph and then displays a message that shows the total number of bookmarks in the document. To use this example, run it from the ThisDocument class in a document-level project.
Private Sub DocumentBookmarks()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "bookmark1")
    MessageBox.Show("Total number of bookmarks: " & Me.Bookmarks.Count.ToString())
End Sub
private void DocumentBookmarks()
{
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Controls.AddBookmark(this.Paragraphs[1].Range, "bookmark1");
    MessageBox.Show("Total number of bookmarks: " + this.Bookmarks.Count.ToString());
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.