[Pythonmac-SIG] Controlling Word from Python on OS X
Paul Berkowitz
berkowit at silcom.com
Tue Mar 2 13:10:25 EST 2004
On 3/2/04 9:49 AM, "Tim Jarman" <tim.jarman at lineone.net> wrote:
> I assume this can be done, but am not sure how best to go about it.
> Specifically, I am trying to automate a mailmerge. Can anyone point me in the
> right direction? MSDN is being its usual 'helpful' self. I'm assuming the
> answer is going to involve AppleEvents but haven't a clue where to start.
>
> (I have done this before under Windows using DDE... God, I feel old...)
AppleScripting Word has not worked properly since v5.1 - when it was very
simple. And MailMerge (Data Merge) did not really exist in Word Mac until
Word X. What works for Word - almost always - is to use the AppleScript 'do
Visual Basic' command with VBA. However, since the Data Merge Manager in
Word X is Mac-only, I'm not 100% positive that it can be done in Word X.
Perhaps so. I created an elaborate set of scripts for Office 2001,
AppleScripting Entourage 2001 to do just about everything that MailMerge was
supposed to do but didn't (in 2001 - works just fine in Word X). They're
called "Office for Office" and you can get them at
MacScripter.net <http://macscripter.net/scriptbuilders/>
But it would be too laborious to convert such large scripts over. You'll
also need to wait for has's AppScript. By that time, Word 2004 will be out,
and you'll find some changes which might be very helpful.
In the meantime, you might have to forget Python and just write a VBA macro
and/or translate it to AppleScript via 'do Visual Basic'.
--
Paul Berkowitz
More information about the Pythonmac-SIG
mailing list