次の方法で共有


DocumentBase.BuiltInDocumentProperties プロパティ

文書のすべての組み込み文書プロパティを表す DocumentProperties コレクションを取得します。

名前空間:  Microsoft.Office.Tools.Word
アセンブリ:  Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll 内)

構文

'宣言
Public ReadOnly Property BuiltInDocumentProperties As Object
    Get
public Object BuiltInDocumentProperties { get; }

プロパティ値

型: System.Object
文書のすべての組み込み文書プロパティを表す DocumentProperties コレクション。

解説

特定の組み込み文書プロパティを表す単一の DocumentProperty を取得するには、Visual Basic で BuiltInDocumentProperties(index) を使用するか、C# で BuiltInDocumentProperties[index] を使用します。ここで、index は、いずれかのWdBuiltInProperty 値です。

Microsoft Office Word で組み込み文書プロパティのいずれかに値が定義されていない場合に、その文書プロパティの Value を読み取ると例外がスローされます。

カスタム文書プロパティのコレクションを返すには、CustomDocumentProperties プロパティを使用します。

文書が作成された日付と時刻を示すメッセージを表示するコード例を次に示します。 この例を使用するには、これをドキュメント レベルのプロジェクトの ThisDocument クラスから実行します。

Private Sub DocumentBuiltInDocumentProperties()
    MessageBox.Show("Document creation: " & CType(Me.BuiltInDocumentProperties, _
        Office.DocumentProperties)(Word.WdBuiltInProperty.wdPropertyTimeCreated). _
        Value.ToString())
End Sub 
private void DocumentBuiltInDocumentProperties()
{
    MessageBox.Show("Document creation: " + ((Office.DocumentProperties)
        (this.BuiltInDocumentProperties))[Word.WdBuiltInProperty.
        wdPropertyTimeCreated].Value.ToString());
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

DocumentBase クラス

Microsoft.Office.Tools.Word 名前空間