Hi SmithStanley1212,
attempt to run a mail merge from data in my Excel Workbook into Word
I think this might be the wrong approach. In my experience you need 3 files:
a. The Excel file running VBA code.
b. The Word Document with the field names
c. The Excel Data File that contains the fields.
Typical VBA code excerpt:
NOTE: Since this code uses 'Late Binding', Word constants such as wdFormLetters must be defined with their actual values in the code. This is a case where 'Option Explicit' is VERY IMPORTANT.
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.
The files associated with post #9 in the following thread provide a working example and should help you get started:
http://www.excelforum.com/excel-prog...ml#post4190498
Lewis
Bookmarks