B2017-138 Add error handling for setting Bottom Margin

Removed debug output
This commit is contained in:
Rich 2017-07-10 15:40:39 +00:00
parent fa68b282b8
commit 537ab3c21c
2 changed files with 17 additions and 4 deletions

View File

@ -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();

View File

@ -1240,10 +1240,23 @@ namespace VEPROMS.CSLA.Library
}
else
myDoc.PageSetup.RightMargin = newRight;
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
{
try