diff --git a/PROMS/LBWordLibrary/LBObjectExtension.cs b/PROMS/LBWordLibrary/LBObjectExtension.cs index a03b27c1..1595f77c 100644 --- a/PROMS/LBWordLibrary/LBObjectExtension.cs +++ b/PROMS/LBWordLibrary/LBObjectExtension.cs @@ -4,6 +4,7 @@ using System.Text; using System.Reflection; using Microsoft.Win32; using System.Windows.Forms; +using System.Text.RegularExpressions; namespace LBWordLibrary { @@ -93,8 +94,6 @@ namespace LBWordLibrary if (!proc.HasExited) KillAndWait(proc); } - - private static void KillAndWait(System.Diagnostics.Process proc) { Console.WriteLine("{0:s.ffff} Killing Adobe", DateTime.Now); @@ -325,6 +324,23 @@ namespace LBWordLibrary { return InvokeMethod("EndKey", Unit, Extend) as int? ?? 0; } + public bool LastWasUpper + { + get + { + LBRange myRange = Range; + int start = myRange.Start - 1; + while (start >= 0) + { + myRange.Start = start; + myRange.End = start + 1; + if (Regex.IsMatch(myRange.Text, "[A-Z]")) return true; + if (Regex.IsMatch(myRange.Text, "[a-z]")) return false; + start = start - 1; + } + return false; + } + } } public partial class LBInlineShapes : LBComObjectList /* Collection */ {