From 77f655579acb72d61ce5e0359af4c7d40a52e144 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 11 Mar 2016 15:31:40 +0000 Subject: [PATCH] Added accessibility to MS Word functionality to page through, jump to next/previous text --- PROMS/LBWordLibrary/LBComObject.cs | 212 ++++++++++++++++++++++++----- 1 file changed, 175 insertions(+), 37 deletions(-) diff --git a/PROMS/LBWordLibrary/LBComObject.cs b/PROMS/LBWordLibrary/LBComObject.cs index 63456181..16772f89 100644 --- a/PROMS/LBWordLibrary/LBComObject.cs +++ b/PROMS/LBWordLibrary/LBComObject.cs @@ -188,6 +188,10 @@ namespace LBWordLibrary { get { return new LBRange(GetProperty("Range")); } } + public LBStyle Style + { + get { return new LBStyle(GetProperty("Style")); } + } public LBParagraphFormatClass ParagraphFormat { get { return new LBParagraphFormatClass(GetProperty("ParagraphFormat")); } @@ -335,6 +339,22 @@ namespace LBWordLibrary { InvokeMethod("TypeBackspace"); } + public int MoveDown() + { + return InvokeMethod("MoveDown", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; + } + public int MoveDown(object Unit, object Count, object Extend) + { + return InvokeMethod("MoveDown", Unit, Count, Extend) as int? ?? 0; + } + public int MoveUp() + { + return InvokeMethod("MoveUp", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; + } + public int MoveUp(object Unit, object Count, object Extend) + { + return InvokeMethod("MoveUp", Unit, Count, Extend) as int? ?? 0; + } } public partial class LBDocumentClass : LBComObject { @@ -482,6 +502,22 @@ namespace LBWordLibrary get { return (GetProperty("Text").ToString()); } set { SetProperty("Text", value); } } + public LBTables Tables + { + get { return new LBTables(GetProperty("Tables")); } + } + public LBRows Rows + { + get { return new LBRows(GetProperty("Rows")); } + } + public LBColumns Columns + { + get { return new LBColumns(GetProperty("Columns")); } + } + public LBCells Cells + { + get { return new LBCells(GetProperty("Cells")); } + } public LBRange GoTo() { return new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value)); @@ -771,6 +807,10 @@ namespace LBWordLibrary get { return (GetProperty("Height") as float? ?? 0); } set { SetProperty("Height", value); } } + public LBBorders Borders + { + get { return new LBBorders(GetProperty("Borders")); } + } public System.Object GetEnumerator() { return InvokeMethod("GetEnumerator"); @@ -957,6 +997,29 @@ namespace LBWordLibrary wdGray25 = 16, wdByAuthor = -1 } + public partial class LBColumns : LBComObjectList /* Collection */ + { + public LBColumns(Object item) + { + Item = item; + } + public LBColumn First + { + get { return new LBColumn(GetProperty("First")); } + } + public LBColumn Last + { + get { return new LBColumn(GetProperty("Last")); } + } + public int Count + { + get { return (GetProperty("Count") as int? ?? 0); } + } + public System.Object GetEnumerator() + { + return InvokeMethod("GetEnumerator"); + } + } public enum LBWdLineSpacing { wdLineSpaceSingle = 0, @@ -1145,6 +1208,17 @@ namespace LBWordLibrary wdCellAlignVerticalCenter = 1, wdCellAlignVerticalBottom = 3 } + public partial class LBBorders : LBComObjectList /* Collection */ + { + public LBBorders(Object item) + { + Item = item; + } + public int Count + { + get { return (GetProperty("Count") as int? ?? 0); } + } + } public partial class LBRow : LBComObject { public LBRow() { } @@ -1309,27 +1383,30 @@ namespace LBWordLibrary set { SetProperty("Percentage", value); } } } - public partial class LBColumns : LBComObjectList /* Collection */ + public partial class LBColumn : LBComObject { - public LBColumns(Object item) + public LBColumn() { } + public LBColumn(Object item) : base(item) { } + public float Width { - Item = item; + get { return (GetProperty("Width") as float? ?? 0); } + set { SetProperty("Width", value); } } - public LBColumn First + public int Index { - get { return new LBColumn(GetProperty("First")); } + get { return (GetProperty("Index") as int? ?? 0); } } - public LBColumn Last + public LBColumn Next { - get { return new LBColumn(GetProperty("Last")); } + get { return new LBColumn(GetProperty("Next")); } } - public int Count + public LBColumn Previous { - get { return (GetProperty("Count") as int? ?? 0); } + get { return new LBColumn(GetProperty("Previous")); } } - public System.Object GetEnumerator() + public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) { - return InvokeMethod("GetEnumerator"); + InvokeMethod("SetWidth", ColumnWidth, RulerStyle); } } public enum LBWdRelativeHorizontalPosition @@ -1361,32 +1438,6 @@ namespace LBWordLibrary wdPageFitBestFit = 2, wdPageFitTextFit = 3 } - public partial class LBColumn : LBComObject - { - public LBColumn() { } - public LBColumn(Object item) : base(item) { } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public int Index - { - get { return (GetProperty("Index") as int? ?? 0); } - } - public LBColumn Next - { - get { return new LBColumn(GetProperty("Next")); } - } - public LBColumn Previous - { - get { return new LBColumn(GetProperty("Previous")); } - } - public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) - { - InvokeMethod("SetWidth", ColumnWidth, RulerStyle); - } - } public enum LBWdRulerStyle { wdAdjustNone = 0, @@ -1394,6 +1445,60 @@ namespace LBWordLibrary wdAdjustFirstColumn = 2, wdAdjustSameWidth = 3 } + public partial class LBBorder : LBComObject + { + public LBBorder() { } + public LBBorder(Object item) : base(item) { } + public LBWdLineStyle LineStyle + { + get { return (LBWdLineStyle)GetProperty("LineStyle"); } + set { SetProperty("LineStyle", value); } + } + public Boolean Visible + { + get { return (GetProperty("Visible") as Boolean? ?? false); } + set { SetProperty("Visible", value); } + } + } + public enum LBWdLineStyle + { + wdLineStyleNone = 0, + wdLineStyleSingle = 1, + wdLineStyleDot = 2, + wdLineStyleDashSmallGap = 3, + wdLineStyleDashLargeGap = 4, + wdLineStyleDashDot = 5, + wdLineStyleDashDotDot = 6, + wdLineStyleDouble = 7, + wdLineStyleTriple = 8, + wdLineStyleThinThickSmallGap = 9, + wdLineStyleThickThinSmallGap = 10, + wdLineStyleThinThickThinSmallGap = 11, + wdLineStyleThinThickMedGap = 12, + wdLineStyleThickThinMedGap = 13, + wdLineStyleThinThickThinMedGap = 14, + wdLineStyleThinThickLargeGap = 15, + wdLineStyleThickThinLargeGap = 16, + wdLineStyleThinThickThinLargeGap = 17, + wdLineStyleSingleWavy = 18, + wdLineStyleDoubleWavy = 19, + wdLineStyleDashDotStroked = 20, + wdLineStyleEmboss3D = 21, + wdLineStyleEngrave3D = 22, + wdLineStyleOutset = 23, + wdLineStyleInset = 24 + } + public enum LBWdBorderType + { + wdBorderDiagonalUp = -8, + wdBorderDiagonalDown = -7, + wdBorderVertical = -6, + wdBorderHorizontal = -5, + wdBorderRight = -4, + wdBorderBottom = -3, + wdBorderLeft = -2, + wdBorderTop = -1 + } public partial class LBCell : LBComObject { public LBCell() { } @@ -1614,4 +1719,37 @@ namespace LBWordLibrary public LBPictureFormat() { } public LBPictureFormat(Object item) : base(item) { } } + public partial class LBStyle : LBComObject + { + public LBStyle() { } + public LBStyle(Object item) : base(item) { } + public String NameLocal + { + get { return (GetProperty("NameLocal").ToString()); } + set { SetProperty("NameLocal", value); } + } + public int ListLevelNumber + { + get { return (GetProperty("ListLevelNumber") as int? ?? 0); } + } + } +// public partial class LBStyles : LBComObjectList /* Collection */ +// { +// public LBStyles(Object item) +// { +// Item = item; +// } +// public int Count +// { +// get { return (GetProperty("Count") as int? ?? 0); } +// } +// public LBStyle Item +// { +// get { return new LBStyle(GetProperty("Item")); } +// } +// public System.Object GetEnumerator() +// { +// return InvokeMethod("GetEnumerator"); +// } +// } }