Last active
June 17, 2023 04:18
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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