Re: Scripting MS Word without VBA?
Re: Scripting MS Word without VBA?
- Subject: Re: Scripting MS Word without VBA?
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 26 Feb 2003 18:43:56 -0800
On 2/26/03 2:30 PM, "Michael Grant" <email@hidden> wrote:
>
On 2/26/03 2:38 PM, "Paul Berkowitz" <email@hidden> wrote:
>
>
>> Can anyone point me to some sample AppleScript code for WordX that doesn't
>
>> involve VBA? The stuff I'm trying to do is pretty simple, but I can't figure
>
>> out how to do much of anything at all with a new document.
>
>
>
> Don't try. It doesn't work right, and it crashes. Use 'do Visual Basic'.
>
> That's what works. End of story. (Maybe not forever...)
>
>
Well, if you've done a tenth as much scripting with Word as you've done with
>
E'rage, you ought to know... but all I wanna do is put a handful of text in
>
a new document! :-(
Well, 'set selection to' is what gives the most trouble. It never comes out
right. I mean, if you don't care about formatting, tabs, etc. or positioning
the cursor it will probably be OK, but otherwise not. There are all sorts of
invisible characters in Word which completely throw AppleScript for a loop.
You can never get an accurate character count or position. There's also a
very weird 'text 14 to text 28' sort of syntax for ranges which never works
right. If you're really just entering text from the default cursor position
in a new document, in the default font, then 'set selection to theText'
should work. For anything else, use 'do Visual basic', which is pretty easy
at this level. Unlike AppleScript, the VBA Help documentation in the VB
Editor is first-rate.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.