From 1412d3ac81d6ca2802b748c1d086ee64b95f89ef Mon Sep 17 00:00:00 2001 From: John Date: Wed, 13 Oct 2010 19:53:48 +0000 Subject: [PATCH] --- .../Extension/DocumentExt.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index cae1613f..59e036d4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -556,16 +556,21 @@ namespace VEPROMS.CSLA.Library MyApp.ActiveDocument.Close(false); if (CloseWordWhenDone) { - 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; + CloseApp(); } 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) { DateTime dtw = DateTime.Now.AddMilliseconds(n);