DocumentBase.BuiltInDocumentProperties 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个 Microsoft.Office.Core.DocumentProperties 集合,该集合表示文档的所有内置文档属性。
public object BuiltInDocumentProperties { get; }
属性值
一个 Microsoft.Office.Core.DocumentProperties 集合,表示文档的所有内置文档属性。
示例
下面的代码示例显示一条消息,该消息显示文档的创建日期和时间。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
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
注解
若要返回 Microsoft.Office.Core.DocumentProperty 代表特定内置文档属性的单个,请 BuiltInDocumentProperties 在 Visual Basic 中使用( index )或 BuiltInDocumentProperties index 在 c # 中使用 [],其中 index 是 WdBuiltInProperty 值之一。
如果 Microsoft Office Word 未定义某个内置文档属性的值,则读取 Value 该文档属性的属性会引发异常。
使用 CustomDocumentProperties 属性返回自定义文档属性的集合。