From 537ab3c21cc09d0a5478aececd9464ac9070542d Mon Sep 17 00:00:00 2001 From: Rich Date: Mon, 10 Jul 2017 15:40:39 +0000 Subject: [PATCH] B2017-138 Add error handling for setting Bottom Margin Removed debug output --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 2 +- .../Extension/DocumentExt.cs | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index c4cc92fb..71cade5a 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -1057,7 +1057,7 @@ namespace VEPROMS if (dti.MyDSOTabPanel != null) dti.MyDSOTabPanel.CloseDSO(); } - _MyLog.WarnFormat("frmVEPROMS_FormClosing"); + //_MyLog.WarnFormat("frmVEPROMS_FormClosing"); if (MyParent == null) { if (MyActivityTimer != null) MyActivityTimer.Dispose(); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs index ee4db539..c69c4947 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs @@ -1240,9 +1240,22 @@ namespace VEPROMS.CSLA.Library } else myDoc.PageSetup.RightMargin = newRight; - myDoc.PageSetup.BottomMargin = newBottom; - myDoc.PageSetup.LeftMargin = newLeft; - myDoc.PageSetup.TopMargin = newTop; + try // B2017-138 Add error handling for setting Bottom Margin + { + myDoc.PageSetup.BottomMargin = newBottom; + myDoc.PageSetup.LeftMargin = newLeft; + myDoc.PageSetup.TopMargin = newTop; + } + catch (Exception ex) + { + if (_MySection != null) + { + _MyLog.ErrorFormat("<<< ERROR >>> MSWord could not set margins\r\n==>'MSWord could not set margins',{0},'{1}','{2}'" + , _MySection.ItemID, _MySection.MyDocVersion.MyFolder.Name, _MySection.ShortPath); + } + else + _MyLog.ErrorFormat("Could not set margins {0}", myDoc.FullName); + } } else {