
wdAllowOnlyReading: Only reading would be allowed means no insertion, formatting, editing, deleting would be allowed.
wdAllowOnlyFormFields: Only form fields would be allowed.
wdAllowOnl圜omments: Only comment would be allowed. Lock Types are derived from WdProtectionType enum and has following constants: Lock Types EnforceStyleLock: Specifies whether formatting restrictions are enforced for a protected document. UseIRM: Specifies whether to use Information Rights Management (IRM) when protecting the document. Password: If supplied, the password to be able to edit the document, or to change or remove protection. If Type is not wdAllowOnlyFormFields, NoReset is ignored. NoReset: False to reset form fields to their default values True to retain the current form field values if the document is protected. Type: The type of protection to be applied.
In this article we are using VBA, VSTO (Visual Studio Tools for office) in C# and VB.Net code style hence following prerequisites are recommended: Syntaxĭocument.Protect(Type, NoReset, Password, UseIRM, EnforceStyleLock) Considering that user is having sensitive information which he/she doesn’t wish to allow anyone to modify in the document. Prevent editing or deleting or adding contents in the word document.