Callable[[MetadataProperty], bool] – A function to test each metadata property for a condition.
value
PropertyValue
PropertyValue – A value for the picked properties.
Returns: int – The number of affected properties.
Example
fromdatetimeimportdatetimefromgroupdocs.metadataimportMetadatafromgroupdocs.metadata.commonimportPropertyValuefromgroupdocs.metadata.taggingimportTagsdefadding_metadata():withMetadata("input.docx")asmetadata:# Add the "last printed" date wherever it is a known but missing propertyproperty_value=PropertyValue(datetime.now())affected=metadata.add_properties(lambdap:Tags.time.printedinlist(p.tags),property_value)print(f"Affected properties: {affected}")metadata.save("output.docx")