How to: Grant Editing Permissions in a Document
- 2 minutes to read
The WinForms Rich Text Editor allows you to enable specific users or groups to edit certain document parts when the whole document is protected from modification
Follow the steps below to grant editing permissions:
- Select a range.
On the Review ribbon tab, click the Range Editing Permissions button to invoke the Editing Permissions Dialog.
In the Editing Permissions dialog, check users and groups who can edit the current range. These permissions are enforced when the document is protected. Click OK to apply changes and close the dialog window.
On the Review ribbon tab, click the Protect Document button to enable document protection.
In the invoked Document Protection dialog, specify the editing type in a protected document (read-only or comments only), provide and confirm a document protection password. Click OK to close the dialog.
The password protection affects the document modification only and is required to unlock the document. The document is opened without prompting for a password.
- Save the document as a DOCX file.
- To enable editing the protected range when opening the document in a RichEditControl, set the AuthenticationOptions.UserName property to an allowed user specified in step 4, or the RangePermission.Group property to an allowed group.
- Load the document from step 7.
- Edit the range. Ranges without edit permission are read-only when document protection is enabled.
Enable document modification by clicking Unprotect Document on the Review ribbon tab. It invokes a simple dialog that prompts for a password or unlocks the document if an empty password was set.