GetDocumentProperty(), GetDocumentProperty$()

Syntax

GetDocumentProperty(Name$ [, CustomOrBuiltIn])

GetDocumentProperty$(Name$ [, CustomOrBuiltIn])

Remarks

GetDocumentProperty() returns the numeric representation of the Name$ property defined in the active document. This can be a built-in property or a custom property. If the Name$ property is a string or a date, or if it is not defined, an error occurs. Yes or No properties are returned as 1 or 0 (zero), respectively.

GetDocumentProperty$() returns the string representation of the Name$ property defined in the active document. This can be a built-in property or a custom property. GetDocumentProperty$() returns an error if the Name$ property is a number or is not defined. Date properties are returned in the default date format, and Yes or No properties are returned as "Y" or "N". Use the DocumentPropertyExists() function to verify that the Name$ property exists.

For a list of the built-in properties available in Word, see DocumentPropertyName$(). In Word version 6.0, GetDocumentProperty() and GetDocumentProperty$() are unavailable and generate errors.

Argument

Explanation

Name$

The name of the property.

CustomOrBuiltIn

Specifies whether Name$ is a built-in property or a custom property:

0 (zero) or omitted Word looks in the list of built-in and custom properties and returns the first matching value.

1 Name$ is a built-in property.

2 Name$ is a custom property.


See Also

DocumentPropertyName$(), DocumentPropertyType(), SetDocumentProperty