Provides access to the document-related properties of an item (like a file or folder).
Public NotInheritable Class DocumentProperties Implements IStorageItemExtraProperties
The DocumentProperties class has these types of members:
The DocumentProperties class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
|RetrievePropertiesAsync||Retrieves the specified properties associated with the item.|
|SavePropertiesAsync()||Saves all properties associated with the item.|
|SavePropertiesAsync(IIterable(IKeyValuePair))||Saves the specified properties and values associated with the item.|
The DocumentProperties class has these properties.
|Read-only||Gets the name of the document author.|
|Read/write||Gets or sets the comments associated with the document.|
|Read-only||Gets the collection of keywords associated with the document.|
|Read/write||Gets or sets the title of the document.|
You can access a DocumentProperties object asynchronously using the GetDocumentPropertiesAsync method from the Properties property of an item (like a file of folder), or synchronously using the DocumentProperties property if it is available.
You can get a DocumentProperties object using any of the following methods and properties:
- FileInformation.documentProperties property
- FolderInformation.documentProperties property
- StorageItemContentProperties.getDocumentPropertiesAsync method, which can be accessed using the Properties property, if it is available.
Note Properties that are get or set using a property handler that is defined by another app (like Microsoft Word) may not be accessible. Instead, you can try to get these properties using a file query that is backed by the system index. For more information, see QueryOptions.
For more code samples about accessing properties, see the File access sample.
This example demonstrates how to use a file query that is backed by the system index to retrieve document properties like Title.
In the example,
file contains a StorageFile that represents the file to retrieve properties for.
Minimum supported client
|Windows 8 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 [Windows Store apps only]|
Minimum supported phone
|Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]|
- StorageItemContentProperties.getDocumentPropertiesAsync method
- Windows.Storage.BulkAccess.FileInformation.documentProperties property
- Windows.Storage.BulkAccess.FolderInformation.documentProperties property
- Windows.Storage.BulkAccess.IStorageItemInformation.DocumentProperties property