Re: closing MSWord files
Re: closing MSWord files
- Subject: Re: closing MSWord files
- From: Shane Stanley <email@hidden>
- Date: Tue, 28 Nov 2000 08:10:09 +1100
On 28/11/00 5:18 AM +1000, Carl West, email@hidden, wrote:
>
I get the feeling that somehow I'm not closing the MS Word files
>
properly in the script below.
It's probably because you're closing the window, rather than the document.
FWIW, this is what I use for Word to text conversions -- it handles
revisions and tables:
on open fileList
with timeout of 300 seconds
tell application "Microsoft Word"
repeat with dataFile in (fileList as list)
set fullPath to (dataFile as text)
open file fullPath
-- in case:
do Visual Basic " ActiveDocument.AcceptAllRevisions"
-- convet tables to tab-delimited; default otherwise is return-delimited
repeat
if exists table 1 then
select table 1
do Visual Basic " Selection.Rows.ConvertToText
Separator:=wdSeparateByTabs"
else
exit repeat
end if
end repeat
set theName to name of window 1
if (count of theName) > 25 then
set fullPath to (text 1 thru 24 of fullPath) & "
"
end if
save document 1 in file (fullPath & ".txt") as "Text Only"
close document 1 saving no
end repeat
end tell
end timeout
end open
--
Shane Stanley, email@hidden