Copying Text Elements From a Current Word Doc To a New Document

U

USER

I'm running Windows Vista Home Premium. I have two Word 2007 templates, A
and B, where A is macro enabled. Word template A contains various TextBox
objects and a button to instantiate a document from template B and populate
the text form fields on B from data in TextBox objects in template A. The
following is the code I have in the button:

Dim NewDoc As Word.Document
Set NewDoc = Word.Documents.Add("MDoT")
NewDoc.Fields("Text1").Result.Text = ThisDocument.tbxBorrower.Text
<----- Type Mismatch
NewDoc.Application.WindowState = wdWindowStateMaximize

I'm expecting the target document to be instantiated and for field "Text1"
to contain what tbxBorrower contains in the first document. However, the
third line above gives a Type Mismatch error. What am I doing wrong so I
can get this simple process to work? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top