Skip to content

Instantly share code, notes, and snippets.

How to Remove Metadata from Word Document using C#. For more details: https://kb.aspose.com/words/net/how-to-remove-metadata-from-word-document-using-csharp/
using Aspose.Words;
using Aspose.Words.Properties;
class Program
{
static void Main(string[] args) // Un-protect Excel file using C#
{
// Set the license
new License().SetLicense("Aspose.Total.lic");
// Load the Word file
Document doc = new Document("SampleProps.doc");
// Access the custom properties
CustomDocumentProperties custProps = doc.CustomDocumentProperties;
custProps.Clear();
// Access the built-in properties
BuiltInDocumentProperties builtInProps = doc.BuiltInDocumentProperties;
builtInProps.Clear();
// Save the Word file
doc.Save("Output.doc");
System.Console.WriteLine("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment