Added Error Handling code
Added a new parameter to SaveSectionDocument and Error Handling Changed error handling for InvokeMember to throw an exception Added code to change the view to PrintMode when determining length
This commit is contained in:
@@ -42,15 +42,7 @@ namespace LBWordLibrary
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(string.Format("{0}.{1} {2} - {3}", _MyType.Name, name, bf.ToString(), ex.GetType().Name));
|
||||
string prefix = "\r\n ";
|
||||
do
|
||||
{
|
||||
sb.Append(prefix + ex.Message);
|
||||
ex = ex.InnerException;
|
||||
} while (ex != null);
|
||||
Console.WriteLine(sb.ToString());
|
||||
throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", _MyType.Name, name), ex);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@@ -263,6 +263,8 @@ namespace LBWordLibrary
|
||||
{
|
||||
get
|
||||
{
|
||||
ActiveWindow.ActivePane.View.Type = LBWdViewType.wdPrintView;
|
||||
ActiveWindow.View.Type = LBWdViewType.wdPrintView;
|
||||
LBPages myPages = ActiveWindow.ActivePane.Pages;// Start with pages
|
||||
float retval = (float)myPages.Count - 1;
|
||||
LBRange myRange = Range();
|
||||
@@ -485,7 +487,7 @@ namespace LBWordLibrary
|
||||
string previous = LBDocumentClass.GetRangeText(myRange);
|
||||
if (Regex.IsMatch(previous, "[A-Z]")) return true;
|
||||
if (Regex.IsMatch(previous, "[a-z]")) return false;
|
||||
start = start - 1;
|
||||
start = start - 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user