DocumentBase.Creator 属性

定义

获取在其中创建文档的应用程序。

public int Creator { get; }

属性值

Int32

在其中创建文档的应用程序。

示例

下面的代码示例显示一条消息,其中显示文档创建者的名称。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

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

注解

如果在 Microsoft Office Word 中创建了指定的对象,则此属性将返回十六进制数4D535744,它表示字符串 "MSWD"。 此值还可以由常数表示 wdCreatorCode

适用于