Sdílet prostřednictvím


DocumentBase.Creator Property

Definition

Gets the application in which the document was created.

public:
 property int Creator { int get(); };
public int Creator { get; }
member this.Creator : int
Public ReadOnly Property Creator As Integer

Property Value

The application in which the document was created.

Examples

The following code example displays a message that shows the name of the creator of the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentCreator()
{
    if (this.Creator == (int)Word.WdConstants.wdCreatorCode)
    {
        MessageBox.Show("The Creator is Microsoft Office Word.");
    }
} 
Private Sub DocumentCreator()
    If Me.Creator = Word.WdConstants.wdCreatorCode Then
        MessageBox.Show("The Creator is Microsoft Office Word.")
    End If
End Sub

Remarks

If the specified object was 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.

Applies to