Programatically uncheck the option to remove personal information


Office documents have a setting to remove personal information each time the document is saved.
If you have track changes and people commenting for example, their names get removed and replaced by a generic "Author" name.

This is sort of a security setting that it's nice to have, most in most cases it gets enabled unintentionally when using the Document Inspector to clean-up documents.

While we can simply open up the trust settings and disable this, there might be times when we need to go over a substantial amount of documents and manual work is no longer effective.

At the same time, this is a good proof of concept should we want to start automating other things on Office documents.

While OpenXML seems to be a clear successor, the Interop Objects still allows us today to interact and manipulate Word documents, in writable Visual Studio C# applications.
Where we can do something as easy as

doc.RemovePersonalInformation = false



Popular posts from this blog

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes

Document ID not being generated