This commit is contained in:
parent
a8a1edd4fd
commit
1412d3ac81
@ -556,16 +556,21 @@ namespace VEPROMS.CSLA.Library
|
|||||||
MyApp.ActiveDocument.Close(false);
|
MyApp.ActiveDocument.Close(false);
|
||||||
if (CloseWordWhenDone)
|
if (CloseWordWhenDone)
|
||||||
{
|
{
|
||||||
WaitMS(300);// This was added because MSWord will sometimes get the error below
|
CloseApp();
|
||||||
// Microsoft Office Word has stopped working
|
|
||||||
// It appears that this is caused by quiting the MS Word application
|
|
||||||
// to soon after closing the document or doing an export.
|
|
||||||
MyApp.Quit(false);
|
|
||||||
_MyApp = null;
|
|
||||||
}
|
}
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CloseApp()
|
||||||
|
{
|
||||||
|
WaitMS(300);// This was added because MSWord will sometimes get the error below
|
||||||
|
// Microsoft Office Word has stopped working
|
||||||
|
// It appears that this is caused by quiting the MS Word application
|
||||||
|
// to soon after closing the document or doing an export.
|
||||||
|
MyApp.Quit(false);
|
||||||
|
_MyApp = null;
|
||||||
|
}
|
||||||
private static void WaitMS(int n)
|
private static void WaitMS(int n)
|
||||||
{
|
{
|
||||||
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
DateTime dtw = DateTime.Now.AddMilliseconds(n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user