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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you just saved me a lot of extra time! Thanks!!!!
ASKER
And sorry for the delay.