Fixed logic so that Word will properly restart if a file has errors.
This commit is contained in:
parent
ebd566dcb2
commit
952ef202c9
@ -221,6 +221,8 @@ namespace DataLoader
|
|||||||
{
|
{
|
||||||
try
|
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)
|
if (myWordDoc != null)
|
||||||
{
|
{
|
||||||
WordDoc.CloseApp();
|
WordDoc.CloseApp();
|
||||||
@ -228,6 +230,13 @@ namespace DataLoader
|
|||||||
while (WordDoc.WordProcesses.Length > 0)
|
while (WordDoc.WordProcesses.Length > 0)
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WordDoc.KillWordApps();
|
||||||
|
Application.DoEvents();
|
||||||
|
while (WordDoc.WordProcesses.Length > 0)
|
||||||
|
Application.DoEvents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user