Mime-Version: |
1.0 (Apple Message framework v753.1) |
Content-Type: |
text/plain; charset=US-ASCII; delsp=yes; format=flowed |
Date: |
Sun, 6 Jun 2010 12:37:47 +0900 |
Reply-To: |
|
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-Transfer-Encoding: |
7bit |
Sender: |
|
Parts/Attachments: |
|
|
Hello Larry,
Thanks for your reply.
On Jun 6, 2010, at 11:37 AM, Larry McMunn wrote:
> On Jun 5, 2010, at 10:00 PM, Nobumi Iyanaga wrote:
>> MS Word: how to save a doc file as rtf file in the SAME folder?
>
> Try this:
>
> set AppleScript's text item delimiters to {""}
> tell application "Microsoft Word"
> set thePath to full name of active document
> tell me
> set oldTIDs to text item delimiters of AppleScript
> set AppleScript's text item delimiters to {"."}
> set newDocPath to text items 1 thru -2 of thePath & "rtf" as string
> set AppleScript's text item delimiters to oldTIDs
> end tell
> save document 1 in newDocPath as format rtf
> end tell
I tried this. Very curiously, this seems to do nothing at all...
But using your code as a hint, I tried this:
set fpath to "Macintosh HD:Users:[me]:Documents:mywork.doc"
set AppleScript's text item delimiters to {""}
tell application "Microsoft Word"
activate
open fpath
set thePath to full name of active document
tell me
set oldTIDs to text item delimiters of AppleScript
set AppleScript's text item delimiters to {"."}
set newDocPath to text items 1 thru -2 of thePath & "rtf" as string
set AppleScript's text item delimiters to oldTIDs
end tell
tell document 1
save as file name (newDocPath) file format format rtf
close
end tell
end tell
And this time, it seems to work well. Although I still don't
understand the reason why some code works, and some others don't, I
think my problem is solved.
Thank you VERY MUCH!
Best regard,
Nobumi Iyanaga
Tokyo,
Japan
|
|
|