Skip to content

Instantly share code, notes, and snippets.

@conholdate-docs-gists
Created August 10, 2022 12:25
Show Gist options
  • Save conholdate-docs-gists/f00c0d1b85ac41622421ad1b083dab07 to your computer and use it in GitHub Desktop.
Save conholdate-docs-gists/f00c0d1b85ac41622421ad1b083dab07 to your computer and use it in GitHub Desktop.
Search metadata properties of a document | https://docs.conholdate.com/net/search-metadata-properties/
// Constants.InputPptx is an absolute or relative path to your document. Ex: @"C:\Docs\source.pptx"
using (Metadata metadata = new Metadata(Constants.InputPptx))
{
// Fetch all the properties satisfying the predicate:
// property contains the name of the last document editor OR the date/time the document was last modified
var properties = metadata.FindProperties(p => p.Tags.Contains(Tags.Person.Editor) || p.Tags.Contains(Tags.Time.Modified));
foreach (var property in properties)
{
Console.WriteLine("Property name: {0}, Property value: {1}", property.Name, property.Value);
}
}
@conholdate-docs-gists
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment