Microsoft Word X always crashes...Update
Microsoft Word X always crashes...Update
- Subject: Microsoft Word X always crashes...Update
- From: Joe Szedula <email@hidden>
- Date: Tue, 3 Jun 2003 22:56:54 -0500
I've found a partial solution to my problem with Word always crashing
when running a macro. I just delete the "Carbon Registration Database"
file before launch Word to run my macro using:
tell application "Finder"
set myHome to (home as text)
set CRD to (myHome & ,
"Library:Preferences:Microsoft:Carbon Registration Database") ,
as text
if file CRD exists then
delete file CRD
end if
end tell
---Last message---
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. The portion of my AppleScript
that runs Word is:
-- "theFile" is something like: myVol:myDir:myFile.doc
tell application "Microsoft Word"
do Visual Basic "Documents.Open FileName:=\"" & theFile & "\""
do Visual Basic " Selection.WholeStory"
do Visual Basic " With ActiveDocument.PageSetup
.LineNumbering.Active = False
.TopMargin = InchesToPoints(0.50)
.BottomMargin = InchesToPoints(0.50)
.LeftMargin = InchesToPoints(0.75)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
End With"
do Visual Basic " Selection.Font.Size = 10"
do Visual Basic " Selection.Font.Name = \"Courier\""
do Visual Basic " ActiveDocument.SaveAs FileFormat:= _
wdFormatDocument, LockComments:=False, Password:=\"\",
AddToRecentFiles:= _
True, WritePassword:=\"\", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveForms
Data:=False, _
SaveAsAOCELetter:=False"
close window theName
end tell
--
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.
I did change the first "do Visual Basic" line from "open file theFile"
because I was getting a "Can't get file" error message from my script.
Anyone know what's wrong? Is the problem with my combination of Mac OS X
and Word X?
Joe Szedula
Email: email@hidden
_______________________________________________
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.