Hi =?Utf-8?B?bWFydGluZA==?=,
I think the best thing would be for you to first start with a new document and add the form or ActiveX fields. (My personal preference is form fields.)
Now you can add a VBA project and put code in it that should execute when the user leaves the first form field. Double-click that field and select the macro from the list for "On exit". Protect the document and test.
If this doesn't do what you need, please explain what the code should be doing in more exact detail and show us the code as it currently looks.
(Note: the problems you're seeing with the ActiveX fields are probably due to 1. the events you've hooked up and 2. writing the code using ThisDocument or ME)
[Quoted Text] > I created a Word template with 3 textboxes. I used Text Form Fields first but > I wanted to populate 2 of them based on user input to 1. (The user would > input a date and I would then calculate the other 2). So I changed to using 3 > ActiveX textboxes. > > I have 2 problems using them. > > 1.) As soon as I create a new document based on the template the textboxes > receive and loose focus in rapid succession. If I click on, say, the 1st of > them it receives focus for about 2 seconds. That is how much time I get to > try and enter anything. Then the second and third receive and loose focus > quickly just like when I create the document. > > 2.) I then created a VB form that runs on the Document Creation Event. It > prompts for the date I want the user to fill in. The user clicks a command > button and the textboxes are updated. It works (sort of). It doesn't populate > the textboxes on the new Document, it populates the textboxes on the > template. When I close the Document I am then prompted to save changes to the > template. If I save the changes, the template is now populated with the > information. > P.S. - The form with the ActiveX textboxes has the same behavior as the form > with the Form Fields. When the Document is created, all 3 textboxes receive > and loose focus in rapid succession. >
Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004) http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-)
|