This class is used to get and set document protection settings for a document.

 public sealed class DocumentProtection
Public NotInheritable Class DocumentProtection

You cannot create a DocumentProtection object using the new keyword. You must get an existing DocumentProtection object from a Document.

MS Word equivalent: Tools menu > Protect Document...

The following sample gets the DocumentProtection object of a document so you can start working with these properties.


          WordApplication app = new WordApplication();
          Document doc = app.Create();
          DocumentProtection docProtect = doc.DocumentProtection;
        

          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim docProtect As DocumentProtection = doc.DocumentProtection
        

Name

Description

AnnotationsLocked

AutoFormatOverride

DocumentProtected

EnforceDocumentProtection

SelectOnlyFormFields

StylesLocked

Name

Description

ProtectionLevel