Document handling in Dynamics AX is a very flexible way to create nice looking Microsoft Office Word documents where Bookmarks in Word are replaced with data from Dynamics AX. Microsoft Office Word on the other hand offers with Form Controls like DropDown Lists nice functionality let users individually customize the Word documents for the given purpose, by also limiting the user to given set of possiblities.
When you now want to use both Dynamics AX Document Handling with a Microsoft Office Word document that uses Form Controls, you run into an either or situation: In order for Form Controls to “work” Document Protection has to be enabled for the Document Template. If Document Protection is however enabled, Dynamics AX Document Handling cannot replace Bookmarks in the protected areas.
If you try to use a protected document with Document Handling you will see the following error message:
The error message here is raised by Microsoft Office Word. Dynamics AX Document Handling is not filling text fields (Bookmarks) but replacing them and this modification is not allowed in a protected document.
But, Microsoft Office Word offers the possibility to enable document protection only to certain sections of a document. So you can place Bookmarks used by Dynamics AX in a section that is kept unprotected and the Form Controls in a section where Document Protection is enabled.
The following description is based on Microsoft Office Word 2007, but you can do the same with earlier versions of Microsoft Office Word, you just have to find out the correct Menu Items…
- First Remove Document Protection
- Start Microsoft Office Word 2007 and open the Document Template for modification (don’t create a document based on the template)
- Select the “Review” Ribbon
- In the group “Protect” click at “Protect Document” and select “Restrict Formatting and Editing”
- In the now visible Taskarea “Restrict Formatting and Editing” click at the “Stop Protection” button
- Next Insert a Section Break
- Click in the line you want to enter the section break
- Select the “Page Layout” Ribbon
- In the group “Page Setup” click at “Breaks” and select “Continuous”
- Turn Document Protection back on
- In the (still visible) Taskarea “Restrict Formatting and Editing” click at the now existing link “Select sections…” under point 2
- Select only “Section 2” as a protected section by removing the checkbox for “Section 1” and click OK
- Click at the “Yes, Start Enforcing Protection” button and click OK (don’t enter a password)
You have now configured a section based Document Protection, where Dynamics AX is able to insert the bookmarks in the unprotected Section 1 and where you are able to use Form Controls in the protected Section 2.
–author: | Alexander Lachner |
–editor: | Alexander Lachner |
–date: | 23/04/2009 |