Word.DocumentProperties class

Represents document properties.

[ API set: WordApi 1.3 ]

Extends
OfficeExtension.ClientObject

Properties

applicationName

Gets the application name of the document. Read only.

[ API set: WordApi 1.3 ]

author

Gets or sets the author of the document.

[ API set: WordApi 1.3 ]

category

Gets or sets the category of the document.

[ API set: WordApi 1.3 ]

comments

Gets or sets the comments of the document.

[ API set: WordApi 1.3 ]

company

Gets or sets the company of the document.

[ API set: WordApi 1.3 ]

creationDate

Gets the creation date of the document. Read only.

[ API set: WordApi 1.3 ]

customProperties

Gets the collection of custom properties of the document. Read only.

[ API set: WordApi 1.3 ]

format

Gets or sets the format of the document.

[ API set: WordApi 1.3 ]

keywords

Gets or sets the keywords of the document.

[ API set: WordApi 1.3 ]

lastAuthor

Gets the last author of the document. Read only.

[ API set: WordApi 1.3 ]

lastPrintDate

Gets the last print date of the document. Read only.

[ API set: WordApi 1.3 ]

lastSaveTime

Gets the last save time of the document. Read only.

[ API set: WordApi 1.3 ]

manager

Gets or sets the manager of the document.

[ API set: WordApi 1.3 ]

revisionNumber

Gets the revision number of the document. Read only.

[ API set: WordApi 1.3 ]

security

Gets the security of the document. Read only.

[ API set: WordApi 1.3 ]

subject

Gets or sets the subject of the document.

[ API set: WordApi 1.3 ]

template

Gets the template of the document. Read only.

[ API set: WordApi 1.3 ]

title

Gets or sets the title of the document.

[ API set: WordApi 1.3 ]

Methods

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

toJSON()
track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you are using this object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created.

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect.

Property Details

applicationName

Gets the application name of the document. Read only.

[ API set: WordApi 1.3 ]

readonly applicationName: string;
Property Value
string

author

Gets or sets the author of the document.

[ API set: WordApi 1.3 ]

author: string;
Property Value
string

category

Gets or sets the category of the document.

[ API set: WordApi 1.3 ]

category: string;
Property Value
string

comments

Gets or sets the comments of the document.

[ API set: WordApi 1.3 ]

comments: string;
Property Value
string

company

Gets or sets the company of the document.

[ API set: WordApi 1.3 ]

company: string;
Property Value
string

creationDate

Gets the creation date of the document. Read only.

[ API set: WordApi 1.3 ]

readonly creationDate: Date;
Property Value
Date

customProperties

Gets the collection of custom properties of the document. Read only.

[ API set: WordApi 1.3 ]

readonly customProperties: Word.CustomPropertyCollection;
Property Value
Word.CustomPropertyCollection

format

Gets or sets the format of the document.

[ API set: WordApi 1.3 ]

format: string;
Property Value
string

keywords

Gets or sets the keywords of the document.

[ API set: WordApi 1.3 ]

keywords: string;
Property Value
string

lastAuthor

Gets the last author of the document. Read only.

[ API set: WordApi 1.3 ]

readonly lastAuthor: string;
Property Value
string

lastPrintDate

Gets the last print date of the document. Read only.

[ API set: WordApi 1.3 ]

readonly lastPrintDate: Date;
Property Value
Date

lastSaveTime

Gets the last save time of the document. Read only.

[ API set: WordApi 1.3 ]

readonly lastSaveTime: Date;
Property Value
Date

manager

Gets or sets the manager of the document.

[ API set: WordApi 1.3 ]

manager: string;
Property Value
string

revisionNumber

Gets the revision number of the document. Read only.

[ API set: WordApi 1.3 ]

readonly revisionNumber: string;
Property Value
string

security

Gets the security of the document. Read only.

[ API set: WordApi 1.3 ]

readonly security: number;
Property Value
number

subject

Gets or sets the subject of the document.

[ API set: WordApi 1.3 ]

subject: string;
Property Value
string

template

Gets the template of the document. Read only.

[ API set: WordApi 1.3 ]

readonly template: string;
Property Value
string

title

Gets or sets the title of the document.

[ API set: WordApi 1.3 ]

title: string;
Property Value
string

Method Details

load(option)

Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties.

load(option?: string | string[]): Word.DocumentProperties;
Parameters
option
string | string[]

A comma-delimited string or an array of strings that specify the properties to load.

Returns
Word.DocumentProperties
Remarks

In addition to this signature, this method has the following signatures:

load(option?: { select?: string; expand?: string; }): Word.DocumentProperties - Where option.select is a comma-delimited string that specifies the properties to load, and options.expand is a comma-delimited string that specifies the navigation properties to load.

load(option?: { select?: string; expand?: string; top?: number; skip?: number }): Word.DocumentProperties - Only available on collection types. It is similar to the preceding signature. Option.top specifies the maximum number of collection items that can be included in the result. Option.skip specifies the number of items that are to be skipped and not included in the result. If option.top is specified, the result set will start after skipping the specified number of items.

toJSON()

toJSON(): Word.Interfaces.DocumentPropertiesData;
Returns
Word.Interfaces.DocumentPropertiesData

track()

Track the object for automatic adjustment based on surrounding changes in the document. This call is a shorthand for context.trackedObjects.add(thisObject). If you are using this object across ".sync" calls and outside the sequential execution of a ".run" batch, and get an "InvalidObjectPath" error when setting a property or invoking a method on the object, you needed to have added the object to the tracked object collection when the object was first created.

track(): Word.DocumentProperties;
Returns
Word.DocumentProperties

untrack()

Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect.

untrack(): Word.DocumentProperties;
Returns
Word.DocumentProperties