次の方法で共有


Workbook.CustomDocumentProperties プロパティ (2007 System)

更新 : 2007 年 11 月

ブックのすべてのカスタム ドキュメント プロパティを示す Microsoft.Office.Core.DocumentProperties コレクションを取得します。

名前空間 :  Microsoft.Office.Tools.Excel
アセンブリ :  Microsoft.Office.Tools.Excel.v9.0 (Microsoft.Office.Tools.Excel.v9.0.dll 内)

構文

'宣言
<BrowsableAttribute(False)> _
Public ReadOnly Property CustomDocumentProperties As Object
'使用
Dim instance As Workbook
Dim value As Object

value = instance.CustomDocumentProperties
[BrowsableAttribute(false)]
public Object CustomDocumentProperties { get; }

プロパティ値

型 : System.Object

ブックのすべてのカスタム ドキュメント プロパティを示す Microsoft.Office.Core.DocumentProperties コレクションです。

解説

このプロパティは、カスタムの ドキュメント プロパティのコレクション全体を返します。プロパティ名またはコレクションのインデックス (数字) を指定して、コレクションから特定のメンバ (Microsoft.Office.Core.DocumentProperties オブジェクト) を返すには、Microsoft.Office.Core.DocumentProperties.Item(System.Object) プロパティを使用します。

組み込み ドキュメント プロパティのコレクションを返すには、BuiltinDocumentProperties を使用します。

次のコード例では、CustomDocumentProperties プロパティを使用して、ワークシート Sheet1 の列 A にある現在のブックのすべてのカスタム ドキュメント プロパティを表示します。

この例は、ドキュメント レベルのカスタマイズ用に作成されています。

Private Sub DisplayCustomDocumentProperties()
    Dim properties As Office.DocumentProperties = _
        CType(Me.CustomDocumentProperties, Office.DocumentProperties)

    Dim i As Integer
    For i = 1 To properties.Count
        Globals.Sheet1.Range("A" & i).Value2 = properties(i).Name
    Next i
End Sub
private void DisplayCustomDocumentProperties()
{
    Office.DocumentProperties properties =
        (Office.DocumentProperties)this.CustomDocumentProperties;

    for (int i = 1; i <= properties.Count; i++)
    {
        Globals.Sheet1.Range["A" + i, missing].Value2 =
            properties[i].Name;
    }
}

アクセス許可

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

参照

参照

Workbook クラス

Workbook メンバ

Microsoft.Office.Tools.Excel 名前空間