|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Permit Code to Run Behind Documents with Restricted Permissions
The features in this topic are available only if you have the required applications installed.
For more information, see.
When you use the Information Rights Management (IRM) feature of Microsoft Office 2003 to restrict permissions to a document or workbook, by default, the code behind the Microsoft Office Word 2003 document or Microsoft Office Excel 2003 workbook is not permitted to run. You can change the default so that your managed code extensions can access the object model, and your solution will work.
You must be the author of the document or workbook or have Full Control access to be able to change the permission settings.
To permit code to run behind documents with restricted permissions
Open the document or workbook in Word 2003 or Excel 2003.
On the File menu, point to Permission, and then click Do Not Distribute.
In the Permission dialog box, click More Options.
Under Additional permissions for users, select Access content programmatically.
Word or Excel will permit programmatic access to the object model.