Application Error when quitting Word 2003

J

Jay

OS: Win2k
Office 2003

Microsoft Office Word has encountered a problem and needs to close.
We are sorry for the inconvenience.

It seems when I open a document in Word using VB.NET and then close it
and try to quit Word I get the above error. I think it has something
to do with Normal.dot. Everytime I get the error I can see the save
progress bar in the bottom left hand corner active.

Here is the test code i'm using:

Sub main()
Dim oWord As Object
oWord = CreateObject("Word.Application")
oWord.documents.open("C:\SaveAs\SaveAs.doc")
oWord.visible = True
oWord.documents.close()
oWord.quit()
oWord = Nothing
End Sub

When I comment out the code that opens a document, Word will open and
close with no problem. I then tried removing the last 3 lines that
close the objects thus leaving the document and word app open. When I
try to manually close Word I still get the error.

This also happens when I run Microsoft's Remove Hidden Data tool from
VB.NET using the command line:

wshshell.Run("cmd /C cd C:\program files\microsoft office\remove
hidden data tool & OFFRHD C:\SaveAs\SaveAs.doc C:\SaveAs\1001.1.doc
/L: C:\SaveAs\Log\rev.txt")

When the tool attempts to close out Word I get the same error.
 
Top