DocumentProperty module

class DocumentProperty.DocumentProperty

Bases: SpireObject, IDocumentProperty

Represents a document property in an Excel workbook.

This class provides functionality to work with built-in and custom document properties such as author, title, subject, keywords, etc. It implements the IDocumentProperty interface and allows reading and modifying these properties in various data types.

property Boolean: bool

Gets or sets the value of the property as a boolean.

Returns:

The boolean value of the property.

Return type:

bool

Clone() SpireObject

Creates a copy of the current document property.

Returns:

A new object that is a copy of this document property.

Return type:

SpireObject

static DEF_FILE_TIME_START_YEAR() int

Gets the default file time start year used for date calculations.

This is typically 1899 or 1904, depending on the workbook settings.

Returns:

The default file time start year.

Return type:

int

property DateTime: DateTime

Gets or sets the value of the property as a DateTime object.

Returns:

The DateTime value of the property.

Return type:

DateTime

property Double: float

Gets or sets the value of the property as a double-precision floating-point number.

Returns:

The double-precision floating-point value of the property.

Return type:

float

property Int32: int

Gets or sets the value of the property as a 32-bit integer.

Returns:

The 32-bit integer value of the property.

Return type:

int

property Integer: int

Gets or sets the value of the property as an integer.

Returns:

The integer value of the property.

Return type:

int

property InternalName: str

Gets the internal name of the property.

Returns:

The internal name of the property as used in the document.

Return type:

str

property IsBuiltIn: bool

Gets whether this property is a built-in document property.

Returns:

True if this is a built-in property; otherwise, False.

Return type:

bool

property LinkSource: str

Gets or sets the source of the linked property.

For a linked property, this is the source from which the property value is obtained.

Returns:

The source of the linked property.

Return type:

str

property LinkToContent: bool

Gets or sets whether the property is linked to content in the document.

When a property is linked to content, its value is updated automatically when the linked content changes.

Returns:

True if the property is linked to content; otherwise, False.

Return type:

bool

property Name: str

Gets the display name of the property.

Returns:

The display name of the property.

Return type:

str

property PropertyId: BuiltInPropertyType

Gets the identifier of the built-in property.

Returns:

An enumeration value identifying the built-in property type.

Return type:

BuiltInPropertyType

property PropertyType: PropertyType

Gets the data type of the property.

Returns:

An enumeration value representing the data type of the property.

Return type:

PropertyType

SetLinkSource(variant: IPropertyData)

Sets the source of the linked property using property data.

Parameters:

variant (IPropertyData) – The property data to use as the link source.

property Text: str

Gets or sets the value of the property as a text string.

Returns:

The text string value of the property.

Return type:

str

property TimeSpan: TimeSpan

Gets or sets the value of the property as a TimeSpan object.

A TimeSpan represents a time interval (duration of time or elapsed time).

Returns:

The TimeSpan value of the property.

Return type:

TimeSpan

property Value: SpireObject

Gets or sets the value of the property as a generic object.

Returns:

The value of the property as a generic object.

Return type:

SpireObject