Automating Word mail merge

  • Thread starter Diana Nemirovsky
  • Start date
D

Diana Nemirovsky

I am using AppleScript to automate a mail merge in Word
(v10.1.5/Panther). The data source is an Excel spreadsheet that has
three worksheets in it. When I open the merge document, a dialog box
appears asking which worksheet I want to use as a data source. The
first one listed is the one I want, so just clicking the OK button
will dismiss the dialog and I'm then good to go - I know how to script
the rest.

However, I can't figure out how to either procedurally specify what
worksheet to link to, or how to procedurally post a click to that
button to dismiss the dialog. I've tried looking at the various
libriaries in the Script Editor to no avail. I've tried recording a
macro with Word that should have captured that action, but the VB it
records makes no reference to the dialog box coming up or being
dismissed -- it just ignores it. Any ideas? The office assistant says
the VBA help files are not installed, but they're not on the
installation CD either.

Thanks in advance.

Diana Nemirovsky
 
P

Paul Berkowitz

I am using AppleScript to automate a mail merge in Word
(v10.1.5/Panther). The data source is an Excel spreadsheet that has
three worksheets in it. When I open the merge document, a dialog box
appears asking which worksheet I want to use as a data source. The
first one listed is the one I want, so just clicking the OK button
will dismiss the dialog and I'm then good to go - I know how to script
the rest.

However, I can't figure out how to either procedurally specify what
worksheet to link to, or how to procedurally post a click to that
button to dismiss the dialog. I've tried looking at the various
libriaries in the Script Editor to no avail. I've tried recording a
macro with Word that should have captured that action, but the VB it
records makes no reference to the dialog box coming up or being
dismissed -- it just ignores it. Any ideas? The office assistant says
the VBA help files are not installed, but they're not on the
installation CD either.

They're in the Value Pack on the CD - you need to use the Value pack
installer. But this is an Excel AppleScript issue (although the VB Help is a
lot more helpful than the AppleScript dictionary. What you want is the Open
command, then Activate Worsksheet "name". You need to Activate Excel itself
before you can Activate the particular Worksheet. I'm not sure if Mail
Merge is fully automated from Word - perhaps it is. When you figure out the
VBA, you can convert it to AppleScript using the 'do Visual Basic' command -
don't try any other way. See

<http://word.mvps.org/FAQs/WordMac/WordAppleScript.htm> in IE - Safari can't
get there.

--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <http://www.entourage.mvps.org/toc.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.

PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.
 

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