在webbrowser控件中怎样关闭当前应用程序?
我使用webbrowser控件嵌入一个word,我代开WORD文档的方式是:axWebBrowser2.Navigate(strFileName, ref refmissing , ref refmissing , ref refmissing , ref refmissing);
在我保存文档后:
((Word.Document)this.axWebBrowser2.Document).SaveAs2000(ref FileName,ref _FileFormat,ref _LockComments,ref _Password, ref _AddToRecentFiles,ref _WritePassword,ref _ReadOnlyRecommended,ref _EnbedTrueTypeFonts ,ref _SavenativePictureFormat,ref _SaveFormsData,ref _SaveAsAoceletter);
我关闭文档或应用程序时总是出错:((Word.Document)this.axWebBrowser2.Document).Close( ref refmissing,ref refmissing,ref refmissing);错误信息:未处理的“System.Runtime. InteropServices. COMException”类型的异常出现在 WindowsApplication1.exe 中。其他信息: 此方法或属性无效,因为 此文档在另一应用程序中。
怎么才能关闭呢?我认为就是WEBBROWSER在使用,但是怎么才能关闭呢?
在线等待!谢谢!