From 952ef202c94bb1742ecf8666174b07dbd2d6136c Mon Sep 17 00:00:00 2001 From: Rich Date: Fri, 16 Jul 2010 19:01:46 +0000 Subject: [PATCH] Fixed logic so that Word will properly restart if a file has errors. --- PROMS/DataLoader/Documents.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PROMS/DataLoader/Documents.cs b/PROMS/DataLoader/Documents.cs index 738d2f0f..7ef31315 100644 --- a/PROMS/DataLoader/Documents.cs +++ b/PROMS/DataLoader/Documents.cs @@ -221,6 +221,8 @@ namespace DataLoader { try { + // RHM 20100628 - All of a sudden, this was null and would not work. + // I added the else clause so that the WinWord process would be terminated. if (myWordDoc != null) { WordDoc.CloseApp(); @@ -228,6 +230,13 @@ namespace DataLoader while (WordDoc.WordProcesses.Length > 0) Application.DoEvents(); } + else + { + WordDoc.KillWordApps(); + Application.DoEvents(); + while (WordDoc.WordProcesses.Length > 0) + Application.DoEvents(); + } } catch (Exception ex) {