Bookmark.Creator Property (2007 System)

Gets a value that indicates the application in which the Bookmark control was created.

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 Creator As Integer
'Usage
Dim instance As Bookmark 
Dim value As Integer 

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

Property Value

Type: System.Int32
The application in which the Bookmark control was created.

Remarks

Because the Bookmark control is created in Microsoft Office Word, this property returns the hexadecimal number 4D535744, which represents the string "MSWD." This value can also be represented by the constant wdCreatorCode.

Examples

The following code example adds a Bookmark control with text to the first paragraph of the document and then displays the creator application in a message box.

This example is for a document-level customization.

Private Sub BookmarkCreator()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")
    Bookmark1.Text = "This is sample bookmark text." 

    If Bookmark1.Creator = Fix(Word.WdConstants.wdCreatorCode) Then
        MessageBox.Show("The Bookmark was created in " & _
            "Microsoft Office Word")
    End If 

End Sub
private void BookmarkCreator()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";

    if (bookmark1.Creator == (int)Word.WdConstants.wdCreatorCode)
    {
        MessageBox.Show("The Bookmark was created in Microsoft Office Word");
    }
}

.NET Framework Security

See Also

Reference

Bookmark Class

Bookmark Members

Microsoft.Office.Tools.Word Namespace