Re: Applescripting Office X
Re: Applescripting Office X
- Subject: Re: Applescripting Office X
- From: "Claude M. CAUWE" <email@hidden>
- Date: Sun, 4 Jan 2004 15:29:45 +0100
paul, many thanks for the useful tips.
I found what I neede (or close to) in your reference documents.
HOWEVER...
Soemthing strange keeps on bugging me.
If I record a VBA script in VBE, and then copy-paste it to AppleScript,
most of the time, I will get a Word error stating "Syntax error" in TMP
DDE"
The offenders being "& vblf &" strings which replace the "carriage
return" in Applescript. even stranger, when I copy-paste the VBA in
Appelscript and run it immediately, no error warning will happoen.
Should I have to modify annything in the Applescript code, then teh "&
vblf &"'s are back, and it crashes the execution.
Would any of you have any idea how to avoid this trouble ?
MTIA
Claude
On Jan 3, 2004, at 18:50, Paul Berkowitz wrote:
--
Paul Berkowitz
From: "Claude M. CAUWE" <email@hidden>
Date: Sat, 3 Jan 2004 18:03:36 +0100
To: <email@hidden>
Subject: Applescripting Office X
I have lots of trouble porting an lawyer's office administrative
system
which relies mainly on a FileMaker set of databases and Applescripts
transferring names, addresses and case references to MS Word
(initially
Office 98) for mail redaction.
In OS 9, simple commands like
tell application "Microsoft Word"
activate
set cell 2 of table 1 of front document to customerAddress
save front document in folderPath & folderName & ":" & saveName
end tell
worked perfectly. Now, with the upgrade to Panther (and, subsequently
to Office X), i'm dumped in big trouble because none of the simple
commands (make new table, set cell .. of table .., etc) works anymore.
For some of them, i for sure can use the "do Visual basic" command,
followed by the reference of the table to be created.
But my most important trouble remains to SET the CELLS of the newly
created table... I need to put variables in these celles, thos
variables being the names and case references, etc..., which come from
FileMaker...
It's all doable via 'do Visual Basic', which is the only way you're
going to
be able to do it in any current version of Word. Unfortunately, it
does mean
learning some of the basics of another scripting language - VBA. The
VBA
Help in Visual Basic Editor is actually very good and you could learn
what
you need to do by following the Help and Examples there. An excellent
primer
is the O'Reilly book "Writing Word Macros": it presents a clear and
orderly
tutorial for learning VBA for Word. It's quite possible to set the
content
of table cells in VBA.
For some guidance on using 'do Visual Basic', including incorporating
AppleScript variables into 'do Visual Basic' commands, see
<http://www.mvps.org/word/FAQs/WordMac/WordAppleScript.htm>
But you have to go there in Internet Explorer - it comes up blank in
Safari.
For some more advanced examples specifically of using tables in
AppleScript,
you might want to work your way through the 'do Visual Basic' parts of
my
script "Print Tasks Lists", which you can get at
MacScripter.net <http://macscripter.net/scriptbuilders/>
Ant help would be grandly appreciated, for no litterature already
exists on how to Applescript Word X.
See the web page above.
_______________________________________________
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.
_______________________________________________
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.