set_document_protection
Set Word document editing restrictions: read-only, comments, tracked changes, or forms. Enforce tracked changes for review, add password protection, and keep automatic backups.
Instructions
Restrict editing: edit = readOnly | comments | trackedChanges | forms. trackedChanges forces every edit by the recipient to be tracked (the send-to-committee mode). Password hashing is Word-compatible SHA-512; this is NOT encryption (com_save_with_password encrypts). Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| edit | No | trackedChanges | |
| backup | No | ||
| password | No | ||
| file_path | Yes | ||
| restrict_formatting | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||