Starting Word from Excel

  • Thread starter Thread starter AndyC812
  • Start date Start date
A

AndyC812

I am trying to write CSV to a temp file from Excel, then start a Word
document with the mail merge template and connect it to the CSV and do a
"Merge to New Document" using an Excel Macro. Wondering how to do this and
will this work in Windows (Office 2003 and 2007) and MAC?

My data is arranged in columns because I will potentially have > 256 fields
(but only one record). Col A is the field headers and Col B the values.

Thanks,
Andy
 
Here is how you start word from excel

sub startwrd
Dim wrd As Object
Set wrd = CreateObject("Word.Application")
wrd.Visible = True
end sub
 
That's a good start. Now how do I specify what file Word should open and
what file it should connect to for Mail Merge, and actually do the merge?
I'm thinking that I will have to have a macro on the Word side that does the
connection and merge. So what remains is how to pass WOrd the name of the
mail merge template to open, the name of the CSV file to connect to and the
name of the final file to save thhe merge to. Any ideas?
 
Back
Top