English 中文(简体)
WORD 2007 w/VBA
原标题:
  • 时间:2009-11-18 17:01:42
  •  标签:
  • vba
  • ms-word

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....

Thanks,

Ferg

问题回答

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!





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签