update_last_printed_property property
SaveOptions.update_last_printed_property property
Gets or sets a value determining whether the BuiltInDocumentProperties.last_printed property is updated before saving.
@property
def update_last_printed_property(self) -> bool:
...
@update_last_printed_property.setter
def update_last_printed_property(self, value: bool):
...
Examples
Shows how to update a document’s “Last printed” property when saving.
doc = aw.Document()
last_printed = datetime.datetime(2019, 12, 20)
doc.built_in_document_properties.last_printed = last_printed
# This flag determines whether the last printed date, which is a built-in property, is updated.
# If so, then the date of the document's most recent save operation
# with this SaveOptions object passed as a parameter is used as the print date.
save_options = aw.saving.DocSaveOptions()
save_options.update_last_printed_property = is_update_last_printed_property
# In Microsoft Word 2003, this property can be found via File -> Properties -> Statistics -> Printed.
# It can also be displayed in the document's body by using a PRINTDATE field.
doc.save(file_name=ARTIFACTS_DIR + 'DocSaveOptions.UpdateLastPrintedProperty.doc', save_options=save_options)
# Open the saved document, then verify the value of the property.
doc = aw.Document(file_name=ARTIFACTS_DIR + 'DocSaveOptions.UpdateLastPrintedProperty.doc')
if is_update_last_printed_property:
self.assertNotEqual(last_printed, doc.built_in_document_properties.last_printed)
else:
self.assertEqual(last_printed, doc.built_in_document_properties.last_printed)
See Also
- module aspose.words.saving
- class SaveOptions