I am trying to complete the creation of a report using the Word Object Model in Visual Basic 2008. After the report is created ans saved as a .doc file, I want to close the document, but everytime that it gets to my close command, I end up receiving an error stating . . .
"Microsoft Office Word has encountered a problem and needs to close. We are sorry for the inconvenience."
I have tried each of the following commands to no avail:
* Me.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
* Application.Documents(reportname).Close(Word.WdSaveOptions.wdDoNotSaveChanges)
* Me.Application.ActiveDocument.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
I have previosuly updated my Office 2007 package with Service Pack 1. Is there anything that can be done?
Please advise.
Thanks.
"Microsoft Office Word has encountered a problem and needs to close. We are sorry for the inconvenience."
I have tried each of the following commands to no avail:
* Me.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
* Application.Documents(reportname).Close(Word.WdSaveOptions.wdDoNotSaveChanges)
* Me.Application.ActiveDocument.Close(Word.WdSaveOptions.wdDoNotSaveChanges)
I have previosuly updated my Office 2007 package with Service Pack 1. Is there anything that can be done?
Please advise.
Thanks.