Re: Microsoft Word X always crashes
Re: Microsoft Word X always crashes
- Subject: Re: Microsoft Word X always crashes
- From: David Wignall <email@hidden>
- Date: Wed, 04 Jun 2003 12:59:36 +1200
on 4/6/2003 10:51 AM, Joe Szedula at email@hidden wrote:
>
Microsoft Word X (updated with: Office X 10.1.2 Update) always crashes
>
when I try to run an AppleScript to open a text file, and convert it to a
>
Word document with the desired formatting.
I have the much the same set-up as you. The script doesn't crash for me
>
The portion of my AppleScript that runs Word is:
<snip>
>
close window theName
>
end tell
Probably a red herring but theName is undefined in the snippet you posted.
>
This used to work using Word 98 in Mac OS 8.6. Trying to run it using
>
Word X on Mac OS X 10.2.6 results in:
>
>
The application Word has unexpectedly quit.
You do have VBA installed, don't you? It is possible to leave it out. Are
there any other Word issues happening or is this it?
I've tidied up your script a little, just to get rid of some of the cruft
and all the selecting of things:
tell application "Microsoft Word"
do Visual Basic "
Documents.Open FileName:=\"" & theFile & "\"
With ActiveDocument
With .PageSetup
.TopMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.75)
.RightMargin = InchesToPoints(0.5)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
End With
With .Range.Font
.Size = 10
.Name = \"Courier\"
End With
End With
ActiveDocument.SaveAs FileFormat:=wdFormatDocument"
--close window theName
end tell
This works OMM, from Smile. Maybe try it and see if things go better? I
don't know what parts of your page set-up are standard so I took out things
that are typically default settings and left the rest. You're not providing
a file name for the SaveAs so you're replacing the existing document with a
Word file format version. My machine seems happy enough with this but maybe
your's isn't.
--
Dave
"Perhaps the truth is less interesting than the facts?"
Amy Weiss,
The RIAA's Senior Vice President of Communications
Email to The Register
_______________________________________________
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.