共用方式為


DocumentBase.BuiltInDocumentProperties Property

Definition

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

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

Property Value

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

Examples

The following code example displays a message that shows the date and time that the document was created. To use this example, run it from the ThisDocument class in a document-level project.

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

Remarks

To return a single Microsoft.Office.Core.DocumentProperty that represents a specific built-in document property, use BuiltInDocumentProperties(index) in Visual Basic or BuiltInDocumentProperties[index] in C#, where index is one of the WdBuiltInProperty values.

If Microsoft Office Word does not define a value for one of the built-in document properties, reading the Value property for that document property throws an exception.

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

Applies to