Page tree
Skip to end of metadata
Go to start of metadata

Description

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

C#
vb.net

Remarks

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.

Examples

C#
vb.net

Properties

Name

Description

AnnotationsLocked

Sets or returns a boolean representing whether or not annotations are locked in this document.

AutoFormatOverride

Sets or returns a boolean representing whether or not Word will autoformat to override a style lock down in this document.

DocumentProtected

Sets or returns a protection level for the document. Possible values are: None, TrackChanges, Comments, Forms, and ReadOnly.

EnforceDocumentProtection

Sets or returns a boolean representing whether or not Word will enforce document protection in this document.

SelectOnlyFormFields

Sets or returns a boolean representing whether or not Word will only allow selections in form fields for this document.

StylesLocked

Sets or returns a boolean representing whether or not Word will lock the Styles in this document.

Nested Classes

Name

Description

ProtectionLevel

A DocumentProtection.ProtectionLevel value specifies what type of editing is allowed in the document.
  • No labels