Udostępnij za pośrednictwem


Document.ContentTypeProperties Property (2007 System)

Gets the metadata that is stored in a document, such as author name, subject, and company.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property ContentTypeProperties As MetaProperties
'Usage
Dim instance As Document 
Dim value As MetaProperties 

value = instance.ContentTypeProperties
[BrowsableAttribute(false)]
public MetaProperties ContentTypeProperties { get; }
[BrowsableAttribute(false)]
public:
property MetaProperties^ ContentTypeProperties {
    MetaProperties^ get ();
}
public function get ContentTypeProperties () : MetaProperties

Property Value

Type: MetaProperties
A MetaProperties collection that represents the metadata that is stored in a document, such as author name, subject, and company.

Examples

The following code example retrieves the metadata that is associated with the current document. The example shows the total number of metadata properties, followed by the name and value of each property. To run this example, you must publish the document to a Microsoft Office SharePoint Server 2007 document library. For more information about content type properties, see Content Types in the Windows SharePoint Services SDK.

This example is for a document-level customization.

Private Sub GetContentTypeProperties()        
    Dim props As Office.MetaProperties = Me.ContentTypeProperties
    MessageBox.Show("Number of metadata properties found: " _
                    + props.Count.ToString())
    For Each prop As Office.MetaProperty In props
        MessageBox.Show("Metadata property name: " + prop.Name _
                + vbCrLf + "Metadata property value: " _
                + prop.Value.ToString())
    Next 
End Sub
private void GetContentTypeProperties()
{
    Office.MetaProperties props = this.ContentTypeProperties;
    MessageBox.Show("Number of metadata properties found: " 
        + props.Count.ToString());
    foreach (Office.MetaProperty prop in props)
    {
        MessageBox.Show("Metadata property name: " + prop.Name 
            + "\r\nMetadata property value: " + prop.Value.ToString());
    }
}

.NET Framework Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace