Partager via


Bookmark.Application Property

Gets an Application that represents the creator of the Bookmark control.

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

Syntax

'Declaration
ReadOnly Property Application As Application
Application Application { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Application
An Application that represents the creator of the Bookmark control.

Examples

The following code example gets, and then displays in a message box, the name and version of the application in which the bookmark appears.

This example is for a document-level customization.

Private Sub BookmarkApplication()

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Dim applicationVersion As String = Bookmark1.Application.Name & _
        " " & Bookmark1.Application.Version
    MessageBox.Show(applicationVersion)

End Sub
private void BookmarkApplication()
{
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
            this.Controls.AddBookmark(this.Paragraphs[1].Range,
            "bookmark1");
    string applicationVersion = bookmark1.Application.Name +
        " " + bookmark1.Application.Version;
    MessageBox.Show(applicationVersion);
}

.NET Framework Security

See Also

Reference

Bookmark Interface

Microsoft.Office.Tools.Word Namespace