Re: Scripting MS Word
Re: Scripting MS Word
- Subject: Re: Scripting MS Word
- From: Shane Stanley <email@hidden>
- Date: Tue, 27 Mar 2001 08:35:51 +1000
On 20/3/01 8:07 AM +1000, Giles Rowland, email@hidden, wrote:
>
I am just starting to get my hands dirty with AppleScript, and I'm running
>
into some trouble scripting Word.
You picked a bad candidate to start with, I'm afraid.
>
>
I want to present the user with a save as dialog in Word, so they can choose
>
their own filename and location for the current document.
Assuming you don't want users to pick the type of file, you can put up your
own dialog using "choose file name" in OS 9.1 or "new file" (same command in
previous versions of the OS).
>
Scripting MS apps
>
seems to involve "Do Visual Basic" steps, but so far my attempts at
>
recording and editing these result in errors, either in AppleScript or
>
Visual Basic.
Fortunately, you can save without resort to VB.
>
>
Can anyone point me in the direction of an appropriate script step to prompt
>
a Word save as dialog.
>
>
I also need to return the filename and location to AppleScript. Any ideas
>
how I should do this?
tell application "Microsoft Word"
set filePath to choose file name -- pre 9.1: set filePath to new file
save document 1 in filePath as "Text Only" -- text should match what
appears in the normal Word format popup
end tell
--
Shane Stanley, email@hidden