Partilhar via


WorkbookBase.BuiltinDocumentProperties Property

Gets a Microsoft.Office.Core.DocumentProperties collection that represents all the built-in document properties for the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property BuiltinDocumentProperties As Object
public Object BuiltinDocumentProperties { get; }

Property Value

Type: System.Object
A Microsoft.Office.Core.DocumentProperties collection that represents all the built-in document properties for the workbook.

Remarks

This property returns the entire collection of built-in document properties. Use the Microsoft.Office.Core.DocumentProperties.Item(System.Object) property to return a single member of the collection (a Microsoft.Office.Core.DocumentProperties object) by specifying either the name of the property or the collection index (as a number).

You can refer to document properties either by index value or by name. The following list shows the available built-in document property names:

  • Title

  • Subject

  • Author

  • Keywords

  • Comments

  • Template

  • Last Author

  • Revision Number

  • Application Name

  • Last Print Date

  • Creation Date

  • Last Save Time

  • Total Editing Time

  • Number of Pages

  • Number of Words

  • Number of Characters

  • Security

  • Category

  • Format

  • Manager

  • Company

  • Number of Bytes

  • Number of Lines

  • Number of Paragraphs

  • Number of Slides

  • Number of Notes

  • Number of Hidden Slides

  • Number of Multimedia Clips

  • Hyperlink Base

  • Number of Characters (with spaces)

Container applications are not required to define values for every built-in document property. If Microsoft Office Excel does not define a value for one of the built-in document properties, reading the Microsoft.Office.Core.DocumentProperties.Value property for that document property throws an exception.

Use the CustomDocumentProperties property to return the collection of custom document properties.

Examples

The following code example uses the BuiltinDocumentProperties property to display all of the built-in document properties of the current workbook in column A of worksheet Sheet1.

This example is for a document-level customization.

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
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;
        }
    }
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace