MetadataAddProperties Method |
Namespace: GroupDocs.Metadata
using (Metadata metadata = new Metadata(Constants.InputDocx)) { // Add a property containing the file last printing date if it's missing // Note that the property will be added to metadata packages that satisfy the following criteria: // 1) Only existing metadata packages will be affected. No new packages are added during this operation // 2) There should be a known metadata property in the package structure that fits the search condition but is actually missing in the package. // All properties supported by a certain package are usually defined in the specification of a particular metadata standard var affected = metadata.AddProperties(p => p.Tags.Contains(Tags.Time.Printed), new PropertyValue(DateTime.Now)); Console.WriteLine("Affected properties: {0}", affected); metadata.Save(Constants.OutputDocx); }