R – WORD 2007 w/VBA


I have a question regarding a WORD 2007 form used to gather information from users. I had it working in WORD 2003 then pulled it over into WORD 2007 and got it working but couldn't leave well enough alone and decided to write it from scratch in WORD 2007. I have cursed that decision ever since….

What I have is some VBA that generates a sequence number and posts it into a field/bookmark in a document. Then I used the pick a date control to capture a date.
Then there are content controls to capture data elements about the user, e.g., name, email address, which get selected from a drop down list. Then there are content controls to capture information about systems, again, name, location, OS, etc.

Then there is a section of the template that used legacy check boxes to identify specific tools and reports, that the user needs to select.

Finally followed by a content control to capture a name and another to pick another date and then the last content control is to capture notes.

The problem I am having is that the VBA code works fine. The sequence number gets generated and posted to the document. That is as far as I get. I understand that the document must be protected for the legacy checkboxes to function as intended. I have tried dviding the template up into sections and and protecting only that section containing the legacy check marks. I have a situation wherein if I "Open" the .dotm file the content controls work but as soon as I double click the .dotm none of the content controls work…

I would be happy to send you the file if it would help you help me….



Best Solution

So the real problem is that when you "Open" the .dotm file, it works, but when you "double click" the .dotm, none of the content controls work?

There is a difference between opening a document template (right click, Open), and opening a document based off of a template. When you double-click the document, its launching a new document based off of the template you double-clicked; the template will be attached to the document, and code should be available (toolbars/controls/code) should load (if the attached template is available).

I realize this is quite an old post...we're curious if you were able to resolve this or not let us know!

Related Question