Link to home
Start Free TrialLog in
Avatar of c10
c10

asked on

VBA form in a Word template

Hi,

I have become very frustrated with the following problem, so I'd be very grateful for any suggestions.

I have a word template, which contains a text field (say "txtName").  I also have a form, which contains a text box (say "txtEnterName").  I want to set txtName to the value of txtEnterName.  I am trying to do this with code like "ThisDocument.txtName = txtEnterName" in the form's code.  This works fine in the template, but whenever I create a new document from the template, it is the template's text field that's altered, not the current document's.

What should I be using instead of "ThisDocument"?


Thank you very much
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of c10
c10

ASKER

Damn that was obvious.

And sorry for the delay.
you just saved me a lot of extra time!  Thanks!!!!