Udostępnij za pośrednictwem


Bookmark.Document Property (2007 System)

Gets the Document associated with the Bookmark control.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property Document As Document
'Usage
Dim instance As Bookmark 
Dim value As Document 

value = instance.Document
[BrowsableAttribute(false)]
public Document Document { get; }
[BrowsableAttribute(false)]
public:
property Document^ Document {
    Document^ get ();
}
public function get Document () : Document

Property Value

Type: Document
The Document associated with the Bookmark control.

Examples

The following code example adds a Bookmark control to the first paragraph in the document and then displays the name of the document containing the bookmark.

This example is for a document-level customization.

Private Sub BookmarkDocument()

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    MessageBox.Show("Bookmark1 is located in: " & _
        Bookmark1.Document.FullName)

End Sub
private void BookmarkDocument()
{
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    MessageBox.Show("bookmark1 is located in: " + 
        bookmark1.Document.FullName);
}

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace