共用方式為


WorkbookBase.BuiltinDocumentProperties 屬性

定義

取得 Microsoft.Office.Core.DocumentProperties 集合,代表活頁簿的所有內建文件屬性。

public:
 property System::Object ^ BuiltinDocumentProperties { System::Object ^ get(); };
public object BuiltinDocumentProperties { get; }
member this.BuiltinDocumentProperties : obj
Public ReadOnly Property BuiltinDocumentProperties As Object

屬性值

Microsoft.Office.Core.DocumentProperties 集合,代表活頁簿的所有內建文檔屬性。

範例

下列程式代碼範例會 BuiltinDocumentProperties 使用 屬性,在工作表 Sheet1的 A 欄顯示目前活頁簿的所有內建文檔屬性。

此範例適用於檔層級自定義。

private void DisplayBuiltinDocumentProperties()
{
    Office.DocumentProperties documentProperties1 =
        (Office.DocumentProperties)this.BuiltinDocumentProperties;

    if (documentProperties1 != null)
    {
        for (int i = 1; i <= documentProperties1.Count; i++)
        {
            Office.DocumentProperty dp = documentProperties1[i];
            Globals.Sheet1.Range["A" + i.ToString()].Value2 =
                dp.Name;
        }
    }
}
Private Sub DisplayBuiltinDocumentProperties()
    Dim DocumentProperties1 As Office.DocumentProperties = _
        CType(Me.BuiltinDocumentProperties,  _
            Office.DocumentProperties)

    If Not (DocumentProperties1 Is Nothing) Then
        Dim i As Integer
        For i = 1 To DocumentProperties1.Count
            Dim dp As Office.DocumentProperty = _
                DocumentProperties1(i)
            Globals.Sheet1.Range("A" & _
                i.ToString()).Value2 = dp.Name
        Next i
    End If
End Sub

備註

這個屬性會傳回內建文檔屬性的整個集合。 Microsoft.Office.Core.DocumentProperties.Item(System.Object)使用 屬性可藉由指定屬性的名稱或集合索引 (做為數位) ,以傳Microsoft.Office.Core.DocumentProperties回物件 (物件) 的單一成員。

您可以依索引值或名稱參考檔屬性。 下列清單顯示可用的內建檔屬性名稱:

  • 標題

  • 主旨

  • 作者

  • 關鍵字

  • 註解

  • 範本

  • 最後一個作者

  • 修訂號碼

  • 應用程式名稱

  • 上次列印日期

  • 建立日期

  • 上次節省時間

  • 編輯時間總計

  • 頁數

  • 字數

  • 字元數

  • 安全性

  • 類別

  • 格式

  • 管理員

  • Company

  • 位元組數目

  • 行數

  • 段落數目

  • 投影片數目

  • 附注數目

  • 隱藏的投影片數目

  • 多媒體剪輯的數目

  • 超連結基底

  • 空格) 的字元數 (數

容器應用程式不需要定義每個內建文檔屬性的值。 如果 Microsoft Office Excel 未定義其中一個內建文檔屬性的值,則讀取 Microsoft.Office.Core.DocumentProperties.Value 該文件屬性的屬性會擲回例外狀況。

CustomDocumentProperties使用屬性可傳回自定義文件屬性的集合。

適用於