Solved

VBA form in a Word template

Posted on 2003-11-06
3
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 175 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
How to incorporate an error traping routing to existing code in VB6 11 49
Spell Check in VB6 13 137
MsgBox 4 71
Set email body to html using vbscript 6 71
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

749 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