Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Word: Visual Basic vs. AppleScript

124 views
Skip to first unread message

Bryan K. Brown

unread,
Mar 30, 2003, 8:02:36 PM3/30/03
to

I'm venturing into the area of complex template, forms and automation
creation -- wondering which tools are best suited to Mac OS X and Office OS
X.

I read a recent post suggesting the VB environment on the Mac was
underwhelming.

My question is: Given that I'm predisposed to focus my scripting efforts on
AppleScript, since it has broader application on the Mac platform, are there
good reasons AGAINST using AppleScript in Word, in favor of VB?

Paul Berkowitz

unread,
Mar 31, 2003, 2:27:33 AM3/31/03
to Bryan K. Brown
On 3/30/03 5:02 PM, in article BAACD3AC.19797%b...@velocitymarketing.net,


Here's the story, Bryan.

VB for Word on the Mac is wonderful. It can do far more than you'll ever
want to do. It is VBA 5.0, not 6.x as on Word Windows, the most important
lack being ActiveX controls, if you should ever need those in forms. It also
can't do the new Print to PDF in Word X.

But VB only works in Word, Excel and PowerPoint on the Mac. Nothing else. If
you're going to be doing inter-application scripting, that's what
AppleScript does - nothing else can do that on the Mac.

The problem is that native AppleScript for Word, as you see it in Word's
AppleScript dictionary, is a disaster, because it doesn't work - it's wrong,
errors, crashes. Don't waste a minute on it. The secret weapon is the one
AppleScript command 'do Visual Basic': it opens the entire world of Word's
VBA to you. Entire. Best of both worlds. See this article for more detail:

<http://www.mvps.org/word/FAQs/WordMac/WordAppleScript.htm>

Yes, it means you'll have to learn two languages. But they're both quite
approachable. I'd recommend "AppleScript in a Nutshell" (O'Reilly) IF you're
an experienced programmer in other languages, not otherwise, possibly "Danny
Goodman's AppleScript Handbook" 2nd ed. (toExcel, available at amazon) , if
not; plus, of course the AppleScript Language Guide, available free in PDF
from Apple's AppleScript web-page. And "Writing Word Macros" (O'Reilly) and
the Help in Word's VB Editor, for Word VBA. Subscribe to the
AppleScript-users mailing list, and go to the .vba.general newsgroup here
for expert help. A few of us on this newsgroup here can advise on 'do Visual
Basic' and any peculiarities of Word VB on the Mac..

Without AppleScript, you won't be able to talk to other applications. Also,
if MS ever decide to fix or revamp Word's AppleScript you'll have a choice
of techniques available.


--
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: http://www.entourage.mvps.org/toc.html

Jerry Krinock

unread,
Apr 3, 2003, 1:55:42 PM4/3/03
to
in article BAAD2DE5.337AC%berk...@silcom.com, Paul Berkowitz at
berk...@silcom.com wrote on 03/03/30 23:27:

> Best of both worlds. See this article for more detail:
>
> <http://www.mvps.org/word/FAQs/WordMac/WordAppleScript.htm>
>

I skimmed through the article, took a few guesses at what I needed to do,
and it Just Worked.

Thanks to Paul Berkowitz and George Clark.

By the way, I do not know VBA, but I'm always able to get the code I need by
recording a macro, and then maybe fixing up the resulting code a little. It
would be a waste of resources a building 1000-entry Applescript dictionary
for Word when this highly developed VBA is already built in. (A minor waste
compared to the invasion or Iraq, but that's another message.)

I would rather see Microsoft doing more useful things we need - like
keyboard customization in Excel, and figuring out a way to make Object
Linking cross-platform to the Macintosh.

Jerry Krinock
San Jose, CA

John McGhie [MVP - Word]

unread,
Apr 11, 2003, 4:19:12 AM4/11/03
to
Hi Jerry:

That's how *everyone* writes VBA :-)

When the new version of Word actually appears, I think you will be
absolutely delighted :-)

Object linking across platform will not happen in the next release: sorry:
it's just too expensive, and you are probably the ONLY person in the whole
wide world who would attempt it :-)

Cheers

This responds to microsoft.public.mac.office.word on Thu, 03 Apr 2003
10:55:42 -0800, Jerry Krinock <jkri...@radiacommunications.com>:

All Spam blocked with SpamNet: a free download from http://www.cloudmark.com/

Please post all comments to the newsgroup to maintain the thread.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
Sydney, Australia. GMT + 10 Hrs
+61 4 1209 1410, mailto:jo...@mcghie-information.com.au

0 new messages