[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBA form in a Word template

Posted on 2003-11-06
3
Medium Priority
?
390 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:c10
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 700 total points
ID: 9699422
ActiveDocument
0
 

Author Comment

by:c10
ID: 9756484
Damn that was obvious.

And sorry for the delay.
0
 
LVL 5

Expert Comment

by:scottman29
ID: 11786682
you just saved me a lot of extra time!  Thanks!!!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question