Document Protection Dialogs
- 2 minutes to read
The Document Protection and Unprotect Document dialogs allow end users to protect a document – specify editing restrictions, set a password, protect sections, and remove protection from a document.
The following protection types are available for documents:
- No changes (Read only)
- Allows read-only access to the document.
- Comments
- Allows users to add comments to the document.
- Tracked Changes
- Allows users to make revisions in a document.
- Filling in Forms
- Allows users to fill in forms and form fields.
End users can click Protect Document or Unprotect Document on the Review ribbon tab to invoke these dialogs. For more information on how to create the ribbon UI for the RichEditControl, refer to the following topic: How to: Create the RichEditControl with a Ribbon UI. You can also execute ProtectDocumentCommand and UnprotectDocumentCommand commands to invoke the dialog.
Use the Document.Protect and Document.Unprotect methods to enforce document protection in code (set the password or remove document protection withou password entry).
To customize the default Document Protection or Unprotect Document dialog (modify captions, set default dialog values, implement custom validation, etc.) or substitute it with completely new dialog, handle the RichEditControl.DocumentProtectionQueryNewPasswordFormShowing or RichEditControl.DocumentProtectionQueryPasswordFormShowing event. The following topics show examples of dialog substitution: