Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quitting Word 2000 Automation Object From Access 2000 - Hanging

Status
Not open for further replies.

FrustratedCoder

Programmer
Nov 11, 2003
4
US
Okay, I am sure someone out there has come across this before, but I am beat. The following code worked fine under Access 97 in conjunction with Word 97.

We have just updated to Office 2000 and now Word hangs when the code is executed. I would be extremely grateful for any help with this.

Code:
Sub TranslateFile(ByVal FileName As String)
    Dim myWord As Word.Document
    
    Set myWord = GetObject(FileName)
    
    myWord.SaveAs Left(FileName, Len(FileName) - 3) & "txt", wdFormatText
    DoEvents
    myWord.Application.Quit
    
    Set myWord = Nothing
    
End Sub

Thanks in advance for your help,
(A VERY) Frustrated Coder ;-)
 
To discover what happens, you may try this before the SaveAs call:
myWord.Application.Visible = True
Another suggestion is to try this:
myWord.Application.DisplayAlerts = False
And another attempt:
myWord.Application.Quit SaveChanges:=wdDoNotSaveChanges

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for that PHV,

I inititally set the application visible property to true, but still saw no requesters or anything that might be hanging it. I next tried to set the save changes to wdDoNotSaveChanges, which still had no effect. Finally, I tried setting displayalerts to false and this seemed to do the trick. Still a bit confused why I hadn't seen any alerts when visible was true, I commented out these new lines (except visible) and the thing still worked! Now I can't get the thing not to work, which is a little scary.

I am going to uncomment the lines again and save it that way, and will monitor it closely to see if the problem re-occurs....

Thanks again for your help,


FC

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top