diff --git a/PROMS/DataLoader/Documents.cs b/PROMS/DataLoader/Documents.cs index 8903481a..e76522a8 100644 --- a/PROMS/DataLoader/Documents.cs +++ b/PROMS/DataLoader/Documents.cs @@ -52,6 +52,7 @@ namespace DataLoader if (System.IO.File.Exists(fname)) { FileInfo myFile = new FileInfo(fname); + frmMain.AddError("Processing {0}", fname); //string tmpName = @"C:\Temp\DataLoader\" + myFile.Name.Replace(".", "_") + ".RTF"; string tmpName = Path.GetTempFileName(); string temppath = Path.GetTempFileName(); @@ -94,7 +95,15 @@ namespace DataLoader // if need landscape set too: bool landscape = (stype[1] == 'L'); myWordDoc.SetLineSpacing(lpi); // if need landscape set too: , landscape); ; } - float docLen = myWordDoc.Length; + float docLen = 1.0f; + try + { + docLen = myWordDoc.Length; + } + catch (Exception ex1) + { + frmMain.AddError("Length Exception {0}\r\n\r\n{1}", ex1.Message, ex1.StackTrace); + } if (ci == null) ci = new ConfigInfo(null); ci.AddItem("Printing", "Length", string.Format("{0:0.0000}", docLen)); string ascii = myWordDoc.MyWordDoc.Ascii; @@ -114,6 +123,7 @@ namespace DataLoader catch (Exception ex) { //frmMain.AddError(ex, "SaveWordDoc"); + frmMain.AddError("Convert Exception {0}\r\n\r\n{1}", ex.Message, ex.StackTrace); if (attempt == 1) frmMain.AddError("vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"); else @@ -125,6 +135,7 @@ namespace DataLoader log.ErrorFormat("oldstepsequence = {0}", fname); log.ErrorFormat("{0}\r\n\r\n{1}", ex.Message, ex.InnerException); log.ErrorFormat(ex.StackTrace); + MSWordToPDF.CloseApp(); switch (attempt) { case 1: // Covert using RTB @@ -310,4 +321,4 @@ namespace DataLoader return done; } } -} \ No newline at end of file +}