1389 lines
51 KiB
C#
1389 lines
51 KiB
C#
using System;
|
|
using System.Reflection;
|
|
using System.Windows.Forms.VisualStyles;
|
|
|
|
namespace LBWordLibrary
|
|
{
|
|
public abstract partial class LBComObject
|
|
{
|
|
private object _Item;
|
|
internal object Item
|
|
{
|
|
get { return _Item; }
|
|
set
|
|
{
|
|
_Item = value;
|
|
if (value != null) MyType = _Item.GetType();
|
|
}
|
|
}
|
|
|
|
public Type MyType { get; set; }
|
|
protected LBComObject() { }
|
|
protected LBComObject(string ProgID)
|
|
{
|
|
Type objClassType;
|
|
objClassType = Type.GetTypeFromProgID(ProgID);
|
|
Item = Activator.CreateInstance(objClassType);
|
|
}
|
|
protected LBComObject(object item) => Item = item;
|
|
private object DoInvokeMember(string name, object[] parameters, BindingFlags bf, Binder b)
|
|
{
|
|
try
|
|
{
|
|
return MyType.InvokeMember(name, bf, b, _Item, parameters);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", MyType.Name, name), ex);
|
|
}
|
|
}
|
|
protected void SetProperty(string propertyName, params object[] parameters) => DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null);
|
|
protected object GetProperty(string propertyName) => DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null);
|
|
protected object GetProperty(string propertyName, params object[] parameters) => DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null);
|
|
protected object InvokeMethod(string methodName, params object[] parameters)
|
|
{
|
|
if (parameters != null)
|
|
FixParameters(parameters);
|
|
return DoInvokeMember(methodName, parameters, BindingFlags.InvokeMethod, null);
|
|
}
|
|
private void FixParameters(object[] parameters)
|
|
{
|
|
// Loop through parameters checking to make sure that none of them are LBComObjects
|
|
for (int i = 0; i < parameters.Length; i++)
|
|
if (parameters[i] is LBComObject)
|
|
parameters[i] = (parameters[i] as LBComObject).Item;
|
|
}
|
|
protected object InvokeMethod(string methodName) => InvokeMethod(methodName, null);
|
|
}
|
|
public class LBComObjectList<TList, TItem> : LBComObject
|
|
where TList : LBComObjectList<TList, TItem>
|
|
where TItem : LBComObject, new()
|
|
{
|
|
public TItem Add()
|
|
{
|
|
TItem tmp = new TItem
|
|
{
|
|
Item = InvokeMethod("Add")
|
|
};
|
|
return tmp;
|
|
}
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
// Get each item in a collection
|
|
public object this[int item] => InvokeMethod("Item", item);// Use Item Method to get an entry from an object list
|
|
}
|
|
public partial class LBApplicationClass : LBComObject
|
|
{
|
|
public LBApplicationClass() : base("Word.Application") { }
|
|
public LBApplicationClass(object item) : base(item) { }
|
|
public bool Visible
|
|
{
|
|
get { return (GetProperty("Visible") as bool? ?? false); }
|
|
set { SetProperty("Visible", value); }
|
|
}
|
|
public LBDocuments Documents => new LBDocuments(GetProperty("Documents"));
|
|
public LBSelection Selection => new LBSelection(GetProperty("Selection"));
|
|
public LBDocumentClass ActiveDocument => new LBDocumentClass(GetProperty("ActiveDocument"));
|
|
public LBWindow ActiveWindow => new LBWindow(GetProperty("ActiveWindow"));
|
|
public string Version => (GetProperty("Version").ToString());
|
|
public string ActivePrinter
|
|
{
|
|
get { return (GetProperty("ActivePrinter").ToString()); }
|
|
set { SetProperty("ActivePrinter", value); }
|
|
}
|
|
public int BackgroundPrintingStatus => (GetProperty("BackgroundPrintingStatus") as int? ?? 0);
|
|
public LBWdWindowState WindowState
|
|
{
|
|
get { return (LBWdWindowState)GetProperty("WindowState"); }
|
|
set { SetProperty("WindowState", value); }
|
|
}
|
|
public int BackgroundSavingStatus => (GetProperty("BackgroundSavingStatus") as int? ?? 0);
|
|
public void Quit() => InvokeMethod("Quit", Missing.Value, Missing.Value, Missing.Value);
|
|
public void Quit(object SaveChanges, object OriginalFormat, object RouteDocument) => InvokeMethod("Quit", SaveChanges, OriginalFormat, RouteDocument);
|
|
public void PrintOut() => InvokeMethod("PrintOut", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
|
public void PrintOut(object Background, object Append, object Range, object OutputFileName, object From, object To, object Item, object Copies, object Pages, object PageType, object PrintToFile, object Collate, object FileName, object ActivePrinterMacGX, object ManualDuplexPrint, object PrintZoomColumn, object PrintZoomRow, object PrintZoomPaperWidth, object PrintZoomPaperHeight) => InvokeMethod("PrintOut", Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight);
|
|
public void Activate() => InvokeMethod("Activate");
|
|
}
|
|
public partial class LBDocuments : LBComObjectList<LBDocuments, LBDocumentClass> /* Collection */
|
|
{
|
|
public LBDocuments(object item) => Item = item;
|
|
public LBDocumentClass Open(object FileName) => new LBDocumentClass(InvokeMethod("Open", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value));
|
|
public LBDocumentClass Open(object FileName, object ConfirmConversions, object ReadOnly, object AddToRecentFiles, object PasswordDocument, object PasswordTemplate, object Revert, object WritePasswordDocument, object WritePasswordTemplate, object Format, object Encoding, object Visible, object OpenAndRepair, object DocumentDirection, object NoEncodingDialog, object XMLTransform) => new LBDocumentClass(InvokeMethod("Open", FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenAndRepair, DocumentDirection, NoEncodingDialog, XMLTransform));
|
|
}
|
|
public partial class LBSelection : LBComObject
|
|
{
|
|
public LBSelection() { }
|
|
public LBSelection(object item) : base(item) { }
|
|
public LBRange Range => new LBRange(GetProperty("Range"));
|
|
public LBStyle Style => new LBStyle(GetProperty("Style"));
|
|
public LBParagraphFormatClass ParagraphFormat => new LBParagraphFormatClass(GetProperty("ParagraphFormat"));
|
|
public string Text
|
|
{
|
|
//B2022-083: Support Conditional RO Values
|
|
get { return Convert.ToString(GetProperty("Text")); }
|
|
set { SetProperty("Text", value); }
|
|
}
|
|
public LBWdSelectionType Type => (LBWdSelectionType)GetProperty("Type");
|
|
public LBFind Find => new LBFind(GetProperty("Find"));
|
|
public LBFontClass Font => new LBFontClass(GetProperty("Font"));
|
|
public int End
|
|
{
|
|
get { return (GetProperty("End") as int? ?? 0); }
|
|
set { SetProperty("End", value); }
|
|
}
|
|
public int Start
|
|
{
|
|
get { return (GetProperty("Start") as int? ?? 0); }
|
|
set { SetProperty("Start", value); }
|
|
}
|
|
public LBInlineShapes InlineShapes => new LBInlineShapes(GetProperty("InlineShapes"));
|
|
public LBParagraphs Paragraphs => new LBParagraphs(GetProperty("Paragraphs"));
|
|
public LBTables Tables
|
|
{
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
get
|
|
{
|
|
try // added Try/Catch logic to allow a null to be returned.
|
|
{
|
|
return new LBTables(GetProperty("Tables"));
|
|
}
|
|
catch
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
public LBCells Cells
|
|
{
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
get
|
|
{
|
|
try // added Try/Catch logic to allow a null to be returned.
|
|
{
|
|
return new LBCells(GetProperty("Cells"));
|
|
}
|
|
catch
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
public LBRows Rows => new LBRows(GetProperty("Rows"));
|
|
public void WholeStory() => InvokeMethod("WholeStory");
|
|
public int MoveStart() => InvokeMethod("MoveStart", Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveStart(object Unit, object Count) => InvokeMethod("MoveStart", Unit, Count) as int? ?? 0;
|
|
public int MoveEnd() => InvokeMethod("MoveEnd", Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveEnd(object Unit, object Count) => InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0;
|
|
public void Copy() => InvokeMethod("Copy");
|
|
public int EndKey() => InvokeMethod("EndKey", Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int EndKey(object Unit, object Extend) => InvokeMethod("EndKey", Unit, Extend) as int? ?? 0;
|
|
public void TypeText(string Text) => InvokeMethod("TypeText", Text);
|
|
public int EndOf() => InvokeMethod("EndOf", Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int EndOf(object Unit, object Extend) => InvokeMethod("EndOf", Unit, Extend) as int? ?? 0;
|
|
public LBRange GoTo() => new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value));
|
|
public LBRange GoTo(object What, object Which, object Count, object Name) => new LBRange(InvokeMethod("GoTo", What, Which, Count, Name));
|
|
public void InsertSymbol(int CharacterNumber) => InvokeMethod("InsertSymbol", CharacterNumber, Missing.Value, Missing.Value, Missing.Value);
|
|
public void InsertSymbol(int CharacterNumber, object Font, object Unicode, object Bias) => InvokeMethod("InsertSymbol", CharacterNumber, Font, Unicode, Bias);
|
|
public int MoveRight() => InvokeMethod("MoveRight", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveRight(object Unit, object Count, object Extend) => InvokeMethod("MoveRight", Unit, Count, Extend) as int? ?? 0;
|
|
public int MoveLeft() => InvokeMethod("MoveLeft", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveLeft(object Unit, object Count, object Extend) => InvokeMethod("MoveLeft", Unit, Count, Extend) as int? ?? 0;
|
|
public void SelectCell() => InvokeMethod("SelectCell");
|
|
public void SelectRow() => InvokeMethod("SelectRow");
|
|
public void SelectColumn() => InvokeMethod("SelectColumn");
|
|
public void TypeParagraph() => InvokeMethod("TypeParagraph");
|
|
public void TypeBackspace() => InvokeMethod("TypeBackspace");
|
|
public int MoveDown() => InvokeMethod("MoveDown", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveDown(object Unit, object Count, object Extend) => InvokeMethod("MoveDown", Unit, Count, Extend) as int? ?? 0;
|
|
public int MoveUp() => InvokeMethod("MoveUp", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0;
|
|
public int MoveUp(object Unit, object Count, object Extend) => InvokeMethod("MoveUp", Unit, Count, Extend) as int? ?? 0;
|
|
}
|
|
public partial class LBDocumentClass : LBComObject
|
|
{
|
|
public LBDocumentClass() { }
|
|
public LBDocumentClass(object item) : base(item) { }
|
|
public LBApplicationClass Application => new LBApplicationClass(GetProperty("Application"));
|
|
public int SaveFormat => (GetProperty("SaveFormat") as int? ?? 0);
|
|
public string FullName => (GetProperty("FullName").ToString());
|
|
public LBShapes Shapes => new LBShapes(GetProperty("Shapes"));
|
|
public LBWindow ActiveWindow => new LBWindow(GetProperty("ActiveWindow"));
|
|
public LBPageSetup PageSetup => new LBPageSetup(GetProperty("PageSetup"));
|
|
public bool Saved
|
|
{
|
|
get { return (GetProperty("Saved") as bool? ?? false); }
|
|
set { SetProperty("Saved", value); }
|
|
}
|
|
public LBTables Tables => new LBTables(GetProperty("Tables"));
|
|
public float DefaultTabStop
|
|
{
|
|
get { return (GetProperty("DefaultTabStop") as float? ?? 0); }
|
|
set { SetProperty("DefaultTabStop", value); }
|
|
}
|
|
public void SaveAs2000() => InvokeMethod("SaveAs2000", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
|
public void SaveAs2000(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter) => InvokeMethod("SaveAs2000", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter);
|
|
public void SaveAs() => InvokeMethod("SaveAs", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
|
public void SaveAs(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter, object Encoding, object InsertLineBreaks, object AllowSubstitutions, object LineEnding, object AddBiDiMarks) => InvokeMethod("SaveAs", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks);
|
|
public void Close() => InvokeMethod("Close", Missing.Value, Missing.Value, Missing.Value);
|
|
public void Close(object SaveChanges, object OriginalFormat, object RouteDocument) => InvokeMethod("Close", SaveChanges, OriginalFormat, RouteDocument);
|
|
public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat) => InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
|
|
public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat, bool OpenAfterExport, LBWdExportOptimizeFor OptimizeFor, LBWdExportRange Range, int From, int To, LBWdExportItem Item, bool IncludeDocProps, bool KeepIRM, LBWdExportCreateBookmarks CreateBookmarks, bool DocStructureTags, bool BitmapMissingFonts, bool UseISO19005_1, object FixedFormatExtClassPtr) => InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, OpenAfterExport, OptimizeFor, Range, From, To, Item, IncludeDocProps, KeepIRM, CreateBookmarks, DocStructureTags, BitmapMissingFonts, UseISO19005_1, FixedFormatExtClassPtr);
|
|
public LBRange Range() => new LBRange(InvokeMethod("Range", Missing.Value, Missing.Value));
|
|
public LBRange Range(object Start, object End) => new LBRange(InvokeMethod("Range", Start, End));
|
|
public bool Undo() => InvokeMethod("Undo", Missing.Value) as bool? ?? false;
|
|
public bool Undo(object Times) => InvokeMethod("Undo", Times) as bool? ?? false;
|
|
}
|
|
public partial class LBWindow : LBComObject
|
|
{
|
|
public LBWindow() { }
|
|
public LBWindow(object item) : base(item) { }
|
|
public LBPane ActivePane => new LBPane(GetProperty("ActivePane"));
|
|
public LBView View => new LBView(GetProperty("View"));
|
|
}
|
|
public enum LBWdWindowState
|
|
{
|
|
wdWindowStateNormal = 0,
|
|
wdWindowStateMaximize = 1,
|
|
wdWindowStateMinimize = 2
|
|
}
|
|
public partial class LBRange : LBComObject
|
|
{
|
|
public LBRange() { }
|
|
|
|
// B2022-088: Find Doc Ro button not working in Word Sections
|
|
public LBFind Find => new LBFind(GetProperty("Find"));
|
|
|
|
public int MoveStart() => InvokeMethod("MoveStart", Missing.Value, Missing.Value) as int? ?? 0;
|
|
|
|
public int MoveStart(object Unit, object Count) => InvokeMethod("MoveStart", Unit, Count) as int? ?? 0;
|
|
|
|
public int MoveEnd() => InvokeMethod("MoveEnd", Missing.Value, Missing.Value) as int? ?? 0;
|
|
|
|
public int MoveEnd(object Unit, object Count) => InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0;
|
|
|
|
public void InsertSymbol(int CharacterNumber) => InvokeMethod("InsertSymbol", CharacterNumber, Missing.Value, Missing.Value, Missing.Value);
|
|
|
|
public void InsertSymbol(int CharacterNumber, object Font, object Unicode, object Bias) => InvokeMethod("InsertSymbol", CharacterNumber, Font, Unicode, Bias);
|
|
|
|
public void TypeText(string Text) => InvokeMethod("TypeText", Text);
|
|
|
|
public LBRange(object item) : base(item) { }
|
|
// B2018-028 Word 2016 has a different value for the Vertical Position Relative to the Text Boundary than older version of Word.
|
|
// We now need to calculated the last row of text in the PROMS attachment differently.
|
|
// We now subtract the TopMargin the Page Setup from the Vertical Position Relative to the Page (Lenght in LBObjectExtension.cs)
|
|
public LBPageSetup PageSetup => new LBPageSetup(GetProperty("PageSetup"));
|
|
// C2019-021 Added LateBinding for ListFormat
|
|
public LBListFormat ListFormat => new LBListFormat(GetProperty("ListFormat"));
|
|
public LBFontClass Font => new LBFontClass(GetProperty("Font"));
|
|
public LBWdColorIndex HighlightColorIndex
|
|
{
|
|
get { return (LBWdColorIndex)GetProperty("HighlightColorIndex"); }
|
|
set { SetProperty("HighlightColorIndex", value); }
|
|
}
|
|
public LBParagraphFormatClass ParagraphFormat => new LBParagraphFormatClass(GetProperty("ParagraphFormat"));
|
|
public LBParagraphs Paragraphs => new LBParagraphs(GetProperty("Paragraphs"));
|
|
public int End
|
|
{
|
|
get { return (GetProperty("End") as int? ?? 0); }
|
|
set { SetProperty("End", value); }
|
|
}
|
|
public int Start
|
|
{
|
|
get { return (GetProperty("Start") as int? ?? 0); }
|
|
set { SetProperty("Start", value); }
|
|
}
|
|
public string Text
|
|
{
|
|
get { return (GetProperty("Text").ToString()); }
|
|
set { SetProperty("Text", value); }
|
|
}
|
|
public LBTables Tables => new LBTables(GetProperty("Tables"));
|
|
public LBRows Rows => new LBRows(GetProperty("Rows"));
|
|
public LBColumns Columns => new LBColumns(GetProperty("Columns"));
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public LBCells Cells
|
|
{
|
|
get
|
|
{
|
|
try // added Try/Catch logic to allow a null to be returned.
|
|
{
|
|
return new LBCells(GetProperty("Cells"));
|
|
}
|
|
catch (Exception)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
public LBRange GoTo() => new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value));
|
|
public LBRange GoTo(object What, object Which, object Count, object Name) => new LBRange(InvokeMethod("GoTo", What, Which, Count, Name));
|
|
public LBRange Select() => new LBRange(InvokeMethod("Select"));
|
|
}
|
|
public partial class LBParagraphFormatClass : LBComObject
|
|
{
|
|
public LBParagraphFormatClass() { }
|
|
public LBParagraphFormatClass(object item) : base(item) { }
|
|
public LBWdLineSpacing LineSpacingRule
|
|
{
|
|
get { return (LBWdLineSpacing)GetProperty("LineSpacingRule"); }
|
|
set { SetProperty("LineSpacingRule", value); }
|
|
}
|
|
public float LineSpacing
|
|
{
|
|
get { return (GetProperty("LineSpacing") as float? ?? 0); }
|
|
set { SetProperty("LineSpacing", value); }
|
|
}
|
|
public float SpaceAfter
|
|
{
|
|
get { return (GetProperty("SpaceAfter") as float? ?? 0); }
|
|
set { SetProperty("SpaceAfter", value); }
|
|
}
|
|
public int SpaceAfterAuto
|
|
{
|
|
get { return (GetProperty("SpaceAfterAuto") as int? ?? 0); }
|
|
set { SetProperty("SpaceAfterAuto", value); }
|
|
}
|
|
public float SpaceBefore
|
|
{
|
|
get { return (GetProperty("SpaceBefore") as float? ?? 0); }
|
|
set { SetProperty("SpaceBefore", value); }
|
|
}
|
|
public int SpaceBeforeAuto
|
|
{
|
|
get { return (GetProperty("SpaceBeforeAuto") as int? ?? 0); }
|
|
set { SetProperty("SpaceBeforeAuto", value); }
|
|
}
|
|
public LBWdParagraphAlignment Alignment
|
|
{
|
|
get { return (LBWdParagraphAlignment)GetProperty("Alignment"); }
|
|
set { SetProperty("Alignment", value); }
|
|
}
|
|
public float FirstLineIndent
|
|
{
|
|
get { return (GetProperty("FirstLineIndent") as float? ?? 0); }
|
|
set { SetProperty("FirstLineIndent", value); }
|
|
}
|
|
public float LeftIndent
|
|
{
|
|
get { return (GetProperty("LeftIndent") as float? ?? 0); }
|
|
set { SetProperty("LeftIndent", value); }
|
|
}
|
|
public float RightIndent
|
|
{
|
|
get { return (GetProperty("RightIndent") as float? ?? 0); }
|
|
set { SetProperty("RightIndent", value); }
|
|
}
|
|
}
|
|
public enum LBWdSelectionType
|
|
{
|
|
wdNoSelection = 0,
|
|
wdSelectionIP = 1,
|
|
wdSelectionNormal = 2,
|
|
wdSelectionFrame = 3,
|
|
wdSelectionColumn = 4,
|
|
wdSelectionRow = 5,
|
|
wdSelectionBlock = 6,
|
|
wdSelectionInlineShape = 7,
|
|
wdSelectionShape = 8
|
|
}
|
|
public partial class LBFind : LBComObject
|
|
{
|
|
public LBFind() { }
|
|
public LBFind(object item) : base(item) { }
|
|
public LBReplacement Replacement => new LBReplacement(GetProperty("Replacement"));
|
|
public bool Forward
|
|
{
|
|
get { return (GetProperty("Forward") as bool? ?? false); }
|
|
set { SetProperty("Forward", value); }
|
|
}
|
|
public LBWdFindWrap Wrap
|
|
{
|
|
get { return (LBWdFindWrap)GetProperty("Wrap"); }
|
|
set { SetProperty("Wrap", value); }
|
|
}
|
|
public bool Format
|
|
{
|
|
get { return (GetProperty("Format") as bool? ?? false); }
|
|
set { SetProperty("Format", value); }
|
|
}
|
|
public bool MatchWholeWord
|
|
{
|
|
get { return (GetProperty("MatchWholeWord") as bool? ?? false); }
|
|
set { SetProperty("MatchWholeWord", value); }
|
|
}
|
|
public bool MatchWildcards
|
|
{
|
|
get { return (GetProperty("MatchWildcards") as bool? ?? false); }
|
|
set { SetProperty("MatchWildcards", value); }
|
|
}
|
|
public bool MatchSoundsLike
|
|
{
|
|
get { return (GetProperty("MatchSoundsLike") as bool? ?? false); }
|
|
set { SetProperty("MatchSoundsLike", value); }
|
|
}
|
|
public bool MatchAllWordForms
|
|
{
|
|
get { return (GetProperty("MatchAllWordForms") as bool? ?? false); }
|
|
set { SetProperty("MatchAllWordForms", value); }
|
|
}
|
|
public string Text
|
|
{
|
|
get { return (GetProperty("Text").ToString()); }
|
|
set { SetProperty("Text", value); }
|
|
}
|
|
public bool MatchCase
|
|
{
|
|
get { return (GetProperty("MatchCase") as bool? ?? false); }
|
|
set { SetProperty("MatchCase", value); }
|
|
}
|
|
public bool Execute() => InvokeMethod("Execute", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value) as bool? ?? false;
|
|
public bool Execute(object FindText, object MatchCase, object MatchWholeWord, object MatchWildcards, object MatchSoundsLike, object MatchAllWordForms, object Forward, object Wrap, object Format, object ReplaceWith, object Replace, object MatchKashida, object MatchDiacritics, object MatchAlefHamza, object MatchControl) => InvokeMethod("Execute", FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl) as bool? ?? false;
|
|
public void ClearFormatting() => InvokeMethod("ClearFormatting");
|
|
}
|
|
public partial class LBFontClass : LBComObject
|
|
{
|
|
public LBFontClass() { }
|
|
public LBFontClass(object item) : base(item) { }
|
|
public LBWdColor Color
|
|
{
|
|
get { return (LBWdColor)GetProperty("Color"); }
|
|
set { SetProperty("Color", value); }
|
|
}
|
|
public int Position
|
|
{
|
|
get { return (GetProperty("Position") as int? ?? 0); }
|
|
set { SetProperty("Position", value); }
|
|
}
|
|
public int Subscript
|
|
{
|
|
get { return (GetProperty("Subscript") as int? ?? 0); }
|
|
set { SetProperty("Subscript", value); }
|
|
}
|
|
public int Superscript
|
|
{
|
|
get { return (GetProperty("Superscript") as int? ?? 0); }
|
|
set { SetProperty("Superscript", value); }
|
|
}
|
|
public float Size
|
|
{
|
|
get { return (GetProperty("Size") as float? ?? 0); }
|
|
set { SetProperty("Size", value); }
|
|
}
|
|
public string Name
|
|
{
|
|
get { return (GetProperty("Name").ToString()); }
|
|
set { SetProperty("Name", value); }
|
|
}
|
|
public LBWdUnderline Underline
|
|
{
|
|
get { return (LBWdUnderline)GetProperty("Underline"); }
|
|
set { SetProperty("Underline", value); }
|
|
}
|
|
public int Bold
|
|
{
|
|
get { return (GetProperty("Bold") as int? ?? 0); }
|
|
set { SetProperty("Bold", value); }
|
|
}
|
|
}
|
|
public enum LBWdInformation
|
|
{
|
|
wdActiveEndAdjustedPageNumber = 1,
|
|
wdActiveEndSectionNumber = 2,
|
|
wdActiveEndPageNumber = 3,
|
|
wdNumberOfPagesInDocument = 4,
|
|
wdHorizontalPositionRelativeToPage = 5,
|
|
wdVerticalPositionRelativeToPage = 6,
|
|
wdHorizontalPositionRelativeToTextBoundary = 7,
|
|
wdVerticalPositionRelativeToTextBoundary = 8,
|
|
wdFirstCharacterColumnNumber = 9,
|
|
wdFirstCharacterLineNumber = 10,
|
|
wdFrameIsSelected = 11,
|
|
wdWithInTable = 12,
|
|
wdStartOfRangeRowNumber = 13,
|
|
wdEndOfRangeRowNumber = 14,
|
|
wdMaximumNumberOfRows = 15,
|
|
wdStartOfRangeColumnNumber = 16,
|
|
wdEndOfRangeColumnNumber = 17,
|
|
wdMaximumNumberOfColumns = 18,
|
|
wdZoomPercentage = 19,
|
|
wdSelectionMode = 20,
|
|
wdCapsLock = 21,
|
|
wdNumLock = 22,
|
|
wdOverType = 23,
|
|
wdRevisionMarking = 24,
|
|
wdInFootnoteEndnotePane = 25,
|
|
wdInCommentPane = 26,
|
|
wdInHeaderFooter = 28,
|
|
wdAtEndOfRowMarker = 31,
|
|
wdReferenceOfType = 32,
|
|
wdHeaderFooterType = 33,
|
|
wdInMasterDocument = 34,
|
|
wdInFootnote = 35,
|
|
wdInEndnote = 36,
|
|
wdInWordMail = 37,
|
|
wdInClipboard = 38
|
|
}
|
|
public partial class LBInlineShapes : LBComObjectList<LBInlineShapes, LBInlineShape> /* Collection */
|
|
{
|
|
public LBInlineShapes(object item) => Item = item;
|
|
public LBInlineShape AddPicture(string FileName) => new LBInlineShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value));
|
|
public LBInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range) => new LBInlineShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Range));
|
|
}
|
|
public partial class LBParagraphs : LBComObjectList<LBParagraphs, LBParagraph> /* Collection */
|
|
{
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public new LBParagraph this[int item] => new LBParagraph(base[item]);
|
|
public LBParagraphs(object item) => Item = item;
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
public LBParagraph First => new LBParagraph(GetProperty("First"));
|
|
public LBParagraph Last => new LBParagraph(GetProperty("Last"));
|
|
public object GetEnumerator() => InvokeMethod("GetEnumerator");
|
|
}
|
|
public partial class LBTables : LBComObjectList<LBTables, LBTable> /* Collection */
|
|
{
|
|
public LBTables(object item) => Item = item;
|
|
public LBTable Add(LBRange Range, int NumRows, int NumColumns) => new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, Missing.Value, Missing.Value));
|
|
public LBTable Add(LBRange Range, int NumRows, int NumColumns, object DefaultTableBehavior, object AutoFitBehavior) => new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior));
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
// Get a Table from a list
|
|
public new LBTable this[int item] => new LBTable(base[item]);
|
|
|
|
}
|
|
public partial class LBCells : LBComObjectList<LBCells, LBCell> /* Collection */
|
|
{
|
|
public LBCells(object item) => Item = item;
|
|
public LBWdCellVerticalAlignment VerticalAlignment
|
|
{
|
|
get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); }
|
|
set { SetProperty("VerticalAlignment", value); }
|
|
}
|
|
public float Height
|
|
{
|
|
get { return (GetProperty("Height") as float? ?? 0); }
|
|
set { SetProperty("Height", value); }
|
|
}
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
public LBBorders Borders => new LBBorders(GetProperty("Borders"));
|
|
public object GetEnumerator() => InvokeMethod("GetEnumerator");
|
|
public void Merge() => InvokeMethod("Merge");
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public new LBCell this[int item] => new LBCell(base[item]);
|
|
|
|
}
|
|
public partial class LBRows : LBComObjectList<LBRows, LBRow> /* Collection */
|
|
{
|
|
public LBRows(object item) => Item = item;
|
|
public int HeadingFormat
|
|
{
|
|
get { return (GetProperty("HeadingFormat") as int? ?? 0); }
|
|
set { SetProperty("HeadingFormat", value); }
|
|
}
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
public LBRow First => new LBRow(GetProperty("First"));
|
|
public int AllowBreakAcrossPages
|
|
{
|
|
get { return (GetProperty("AllowBreakAcrossPages") as int? ?? 0); }
|
|
set { SetProperty("AllowBreakAcrossPages", value); }
|
|
}
|
|
}
|
|
public partial class LBShapes : LBComObjectList<LBShapes, LBShape> /* Collection */
|
|
{
|
|
public LBShapes(object item) => Item = item;
|
|
public LBShape AddPicture(string FileName) => new LBShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value));
|
|
public LBShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Left, object Top, object Width, object Height, object Anchor) => new LBShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Anchor));
|
|
}
|
|
public partial class LBPageSetup : LBComObject
|
|
{
|
|
public LBPageSetup() { }
|
|
public LBPageSetup(object item) : base(item) { }
|
|
public float BottomMargin
|
|
{
|
|
get { return (GetProperty("BottomMargin") as float? ?? 0); }
|
|
set { SetProperty("BottomMargin", value); }
|
|
}
|
|
public float LeftMargin
|
|
{
|
|
get { return (GetProperty("LeftMargin") as float? ?? 0); }
|
|
set { SetProperty("LeftMargin", value); }
|
|
}
|
|
public float RightMargin
|
|
{
|
|
get { return (GetProperty("RightMargin") as float? ?? 0); }
|
|
set { SetProperty("RightMargin", value); }
|
|
}
|
|
public float TopMargin
|
|
{
|
|
get { return (GetProperty("TopMargin") as float? ?? 0); }
|
|
set { SetProperty("TopMargin", value); }
|
|
}
|
|
public LBWdOrientation Orientation
|
|
{
|
|
get { return (LBWdOrientation)GetProperty("Orientation"); }
|
|
set { SetProperty("Orientation", value); }
|
|
}
|
|
public float PageHeight
|
|
{
|
|
get { return (GetProperty("PageHeight") as float? ?? 0); }
|
|
set { SetProperty("PageHeight", value); }
|
|
}
|
|
public float PageWidth
|
|
{
|
|
get { return (GetProperty("PageWidth") as float? ?? 0); }
|
|
set { SetProperty("PageWidth", value); }
|
|
}
|
|
public LBWdPaperSize PaperSize
|
|
{
|
|
get { return (LBWdPaperSize)GetProperty("PaperSize"); }
|
|
set { SetProperty("PaperSize", value); }
|
|
}
|
|
public float LinesPage
|
|
{
|
|
get { return (GetProperty("LinesPage") as float? ?? 0); }
|
|
set { SetProperty("LinesPage", value); }
|
|
}
|
|
public float CharsLine
|
|
{
|
|
get { return (GetProperty("CharsLine") as float? ?? 0); }
|
|
set { SetProperty("CharsLine", value); }
|
|
}
|
|
}
|
|
public enum LBWdExportFormat
|
|
{
|
|
wdExportFormatPDF = 17,
|
|
wdExportFormatXPS = 18
|
|
}
|
|
public enum LBWdExportOptimizeFor
|
|
{
|
|
wdExportOptimizeForPrint = 0,
|
|
wdExportOptimizeForOnScreen = 1
|
|
}
|
|
public enum LBWdExportRange
|
|
{
|
|
wdExportAllDocument = 0,
|
|
wdExportSelection = 1,
|
|
wdExportCurrentPage = 2,
|
|
wdExportFromTo = 3
|
|
}
|
|
public enum LBWdExportItem
|
|
{
|
|
wdExportDocumentContent = 0,
|
|
wdExportDocumentWithMarkup = 7
|
|
}
|
|
public enum LBWdExportCreateBookmarks
|
|
{
|
|
wdExportCreateNoBookmarks = 0,
|
|
wdExportCreateHeadingBookmarks = 1,
|
|
wdExportCreateWordBookmarks = 2
|
|
}
|
|
public partial class LBPane : LBComObject
|
|
{
|
|
public LBPane() { }
|
|
public LBPane(object item) : base(item) { }
|
|
public LBPages Pages => new LBPages(GetProperty("Pages"));
|
|
public LBView View => new LBView(GetProperty("View"));
|
|
}
|
|
public partial class LBView : LBComObject
|
|
{
|
|
public LBView() { }
|
|
public LBView(object item) : base(item) { }
|
|
public LBWdViewType Type
|
|
{
|
|
get { return (LBWdViewType)GetProperty("Type"); }
|
|
set { SetProperty("Type", value); }
|
|
}
|
|
public bool ShowRevisionsAndComments
|
|
{
|
|
get { return (GetProperty("ShowRevisionsAndComments") as bool? ?? false); }
|
|
set { SetProperty("ShowRevisionsAndComments", value); }
|
|
}
|
|
public LBWdRevisionsView RevisionsView
|
|
{
|
|
get { return (LBWdRevisionsView)GetProperty("RevisionsView"); }
|
|
set { SetProperty("RevisionsView", value); }
|
|
}
|
|
public LBZoom Zoom => new LBZoom(GetProperty("Zoom"));
|
|
}
|
|
public enum LBWdColorIndex
|
|
{
|
|
wdNoHighlight = 0,
|
|
wdBlack = 1,
|
|
wdBlue = 2,
|
|
wdTurquoise = 3,
|
|
wdBrightGreen = 4,
|
|
wdPink = 5,
|
|
wdRed = 6,
|
|
wdYellow = 7,
|
|
wdWhite = 8,
|
|
wdDarkBlue = 9,
|
|
wdTeal = 10,
|
|
wdGreen = 11,
|
|
wdViolet = 12,
|
|
wdDarkRed = 13,
|
|
wdDarkYellow = 14,
|
|
wdGray50 = 15,
|
|
wdGray25 = 16,
|
|
wdByAuthor = -1
|
|
}
|
|
public partial class LBColumns : LBComObjectList<LBColumns, LBColumn> /* Collection */
|
|
{
|
|
public LBColumns(object item) => Item = item;
|
|
public LBColumn First => new LBColumn(GetProperty("First"));
|
|
public LBColumn Last => new LBColumn(GetProperty("Last"));
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
public object GetEnumerator() => InvokeMethod("GetEnumerator");
|
|
public new LBColumn this[int item] => new LBColumn(base[item]);
|
|
|
|
}
|
|
public enum LBWdLineSpacing
|
|
{
|
|
wdLineSpaceSingle = 0,
|
|
wdLineSpace1pt5 = 1,
|
|
wdLineSpaceDouble = 2,
|
|
wdLineSpaceAtLeast = 3,
|
|
wdLineSpaceExactly = 4,
|
|
wdLineSpaceMultiple = 5
|
|
}
|
|
public enum LBWdParagraphAlignment
|
|
{
|
|
wdAlignParagraphLeft = 0,
|
|
wdAlignParagraphCenter = 1,
|
|
wdAlignParagraphRight = 2,
|
|
wdAlignParagraphJustify = 3,
|
|
wdAlignParagraphDistribute = 4,
|
|
wdAlignParagraphJustifyMed = 5,
|
|
wdAlignParagraphJustifyHi = 7,
|
|
wdAlignParagraphJustifyLow = 8,
|
|
wdAlignParagraphThaiJustify = 9
|
|
}
|
|
public partial class LBReplacement : LBComObject
|
|
{
|
|
public LBReplacement() { }
|
|
public LBReplacement(object item) : base(item) { }
|
|
public string Text
|
|
{
|
|
get { return (GetProperty("Text").ToString()); }
|
|
set { SetProperty("Text", value); }
|
|
}
|
|
public void ClearFormatting() => InvokeMethod("ClearFormatting");
|
|
}
|
|
public enum LBWdFindWrap
|
|
{
|
|
wdFindStop = 0,
|
|
wdFindContinue = 1,
|
|
wdFindAsk = 2
|
|
}
|
|
public enum LBWdColor
|
|
{
|
|
wdColorBlack = 0,
|
|
wdColorDarkRed = 128,
|
|
wdColorRed = 255,
|
|
wdColorDarkGreen = 13056,
|
|
wdColorOliveGreen = 13107,
|
|
wdColorBrown = 13209,
|
|
wdColorOrange = 26367,
|
|
wdColorGreen = 32768,
|
|
wdColorDarkYellow = 32896,
|
|
wdColorLightOrange = 39423,
|
|
wdColorLime = 52377,
|
|
wdColorGold = 52479,
|
|
wdColorBrightGreen = 65280,
|
|
wdColorYellow = 65535,
|
|
wdColorGray95 = 789516,
|
|
wdColorGray90 = 1644825,
|
|
wdColorGray875 = 2105376,
|
|
wdColorGray85 = 2500134,
|
|
wdColorGray80 = 3355443,
|
|
wdColorGray75 = 4210752,
|
|
wdColorGray70 = 5000268,
|
|
wdColorGray65 = 5855577,
|
|
wdColorGray625 = 6316128,
|
|
wdColorDarkTeal = 6697728,
|
|
wdColorPlum = 6697881,
|
|
wdColorGray60 = 6710886,
|
|
wdColorSeaGreen = 6723891,
|
|
wdColorGray55 = 7566195,
|
|
wdColorDarkBlue = 8388608,
|
|
wdColorViolet = 8388736,
|
|
wdColorTeal = 8421376,
|
|
wdColorGray50 = 8421504,
|
|
wdColorGray45 = 9211020,
|
|
wdColorIndigo = 10040115,
|
|
wdColorBlueGray = 10053222,
|
|
wdColorGray40 = 10066329,
|
|
wdColorTan = 10079487,
|
|
wdColorLightYellow = 10092543,
|
|
wdColorGray375 = 10526880,
|
|
wdColorGray35 = 10921638,
|
|
wdColorGray30 = 11776947,
|
|
wdColorGray25 = 12632256,
|
|
wdColorRose = 13408767,
|
|
wdColorAqua = 13421619,
|
|
wdColorGray20 = 13421772,
|
|
wdColorLightGreen = 13434828,
|
|
wdColorGray15 = 14277081,
|
|
wdColorGray125 = 14737632,
|
|
wdColorGray10 = 15132390,
|
|
wdColorGray05 = 15987699,
|
|
wdColorBlue = 16711680,
|
|
wdColorPink = 16711935,
|
|
wdColorLightBlue = 16737843,
|
|
wdColorLavender = 16751052,
|
|
wdColorSkyBlue = 16763904,
|
|
wdColorPaleBlue = 16764057,
|
|
wdColorTurquoise = 16776960,
|
|
wdColorLightTurquoise = 16777164,
|
|
wdColorWhite = 16777215,
|
|
wdColorAutomatic = -16777216
|
|
}
|
|
public enum LBWdUnderline
|
|
{
|
|
wdUnderlineNone = 0,
|
|
wdUnderlineSingle = 1,
|
|
wdUnderlineWords = 2,
|
|
wdUnderlineDouble = 3,
|
|
wdUnderlineDotted = 4,
|
|
wdUnderlineThick = 6,
|
|
wdUnderlineDash = 7,
|
|
wdUnderlineDotDash = 9,
|
|
wdUnderlineDotDotDash = 10,
|
|
wdUnderlineWavy = 11,
|
|
wdUnderlineDottedHeavy = 20,
|
|
wdUnderlineDashHeavy = 23,
|
|
wdUnderlineDotDashHeavy = 25,
|
|
wdUnderlineDotDotDashHeavy = 26,
|
|
wdUnderlineWavyHeavy = 27,
|
|
wdUnderlineDashLong = 39,
|
|
wdUnderlineWavyDouble = 43,
|
|
wdUnderlineDashLongHeavy = 55
|
|
}
|
|
public partial class LBInlineShape : LBComObject
|
|
{
|
|
public LBInlineShape() { }
|
|
public LBInlineShape(object item) : base(item) { }
|
|
public float Height
|
|
{
|
|
get { return (GetProperty("Height") as float? ?? 0); }
|
|
set { SetProperty("Height", value); }
|
|
}
|
|
public float Width
|
|
{
|
|
get { return (GetProperty("Width") as float? ?? 0); }
|
|
set { SetProperty("Width", value); }
|
|
}
|
|
}
|
|
public partial class LBParagraph : LBComObject
|
|
{
|
|
public LBParagraph() { }
|
|
public LBParagraph(object item) : base(item) { }
|
|
public LBRange Range => new LBRange(GetProperty("Range"));
|
|
}
|
|
public partial class LBTable : LBComObject
|
|
{
|
|
public LBTable() { }
|
|
public LBTable(object item) : base(item) { }
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public LBRange Range => new LBRange(GetProperty("Range"));
|
|
public LBColumns Columns => new LBColumns(GetProperty("Columns"));
|
|
public LBRows Rows => new LBRows(GetProperty("Rows"));
|
|
public float TopPadding
|
|
{
|
|
get { return (GetProperty("TopPadding") as float? ?? 0); }
|
|
set { SetProperty("TopPadding", value); }
|
|
}
|
|
public float RightPadding
|
|
{
|
|
get { return (GetProperty("RightPadding") as float? ?? 0); }
|
|
set { SetProperty("RightPadding", value); }
|
|
}
|
|
public float LeftPadding
|
|
{
|
|
get { return (GetProperty("LeftPadding") as float? ?? 0); }
|
|
set { SetProperty("LeftPadding", value); }
|
|
}
|
|
public float BottomPadding
|
|
{
|
|
get { return (GetProperty("BottomPadding") as float? ?? 0); }
|
|
set { SetProperty("BottomPadding", value); }
|
|
}
|
|
}
|
|
public enum LBWdCellVerticalAlignment
|
|
{
|
|
wdCellAlignVerticalTop = 0,
|
|
wdCellAlignVerticalCenter = 1,
|
|
wdCellAlignVerticalBottom = 3
|
|
}
|
|
public partial class LBBorders : LBComObjectList<LBBorders, LBBorder> /* Collection */
|
|
{
|
|
public LBBorders(object item) => Item = item;
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
}
|
|
public partial class LBRow : LBComObject
|
|
{
|
|
public LBRow() { }
|
|
public LBRow(object item) : base(item) { }
|
|
public float Height
|
|
{
|
|
get { return (GetProperty("Height") as float? ?? 0); }
|
|
set { SetProperty("Height", value); }
|
|
}
|
|
public void Select() => InvokeMethod("Select");
|
|
}
|
|
public partial class LBShape : LBComObject
|
|
{
|
|
public LBShape() { }
|
|
public LBShape(object item) : base(item) { }
|
|
public void ConvertToInlineShape() => InvokeMethod("ConvertToInlineShape");
|
|
public float Height
|
|
{
|
|
get { return (GetProperty("Height") as float? ?? 0); }
|
|
set { SetProperty("Height", value); }
|
|
}
|
|
public float Width
|
|
{
|
|
get { return (GetProperty("Width") as float? ?? 0); }
|
|
set { SetProperty("Width", value); }
|
|
}
|
|
public LBRange Anchor => new LBRange(GetProperty("Anchor"));
|
|
public LBMsoTriState LockAspectRatio
|
|
{
|
|
get { return (LBMsoTriState)GetProperty("LockAspectRatio"); }
|
|
set { SetProperty("LockAspectRatio", value); }
|
|
}
|
|
public float Left
|
|
{
|
|
get { return (GetProperty("Left") as float? ?? 0); }
|
|
set { SetProperty("Left", value); }
|
|
}
|
|
public float LeftRelative
|
|
{
|
|
get { return (GetProperty("LeftRelative") as float? ?? 0); }
|
|
set { SetProperty("LeftRelative", value); }
|
|
}
|
|
public float Top
|
|
{
|
|
get { return (GetProperty("Top") as float? ?? 0); }
|
|
set { SetProperty("Top", value); }
|
|
}
|
|
public float TopRelative
|
|
{
|
|
get { return (GetProperty("TopRelative") as float? ?? 0); }
|
|
set { SetProperty("TopRelative", value); }
|
|
}
|
|
public LBWdRelativeHorizontalPosition RelativeHorizontalPosition
|
|
{
|
|
get { return (LBWdRelativeHorizontalPosition)GetProperty("RelativeHorizontalPosition"); }
|
|
set { SetProperty("RelativeHorizontalPosition", value); }
|
|
}
|
|
public LBWdRelativeVerticalPosition RelativeVerticalPosition
|
|
{
|
|
get { return (LBWdRelativeVerticalPosition)GetProperty("RelativeVerticalPosition"); }
|
|
set { SetProperty("RelativeVerticalPosition", value); }
|
|
}
|
|
public int LockAnchor
|
|
{
|
|
get { return (GetProperty("LockAnchor") as int? ?? 0); }
|
|
set { SetProperty("LockAnchor", value); }
|
|
}
|
|
public bool LayoutInCell
|
|
{
|
|
get { return (GetProperty("LayoutInCell") as bool? ?? false); }
|
|
set { SetProperty("LayoutInCell", value); }
|
|
}
|
|
}
|
|
public enum LBWdOrientation
|
|
{
|
|
wdOrientPortrait = 0,
|
|
wdOrientLandscape = 1
|
|
}
|
|
public enum LBWdPaperSize
|
|
{
|
|
wdPaper10x14 = 0,
|
|
wdPaper11x17 = 1,
|
|
wdPaperLetter = 2,
|
|
wdPaperLetterSmall = 3,
|
|
wdPaperLegal = 4,
|
|
wdPaperExecutive = 5,
|
|
wdPaperA3 = 6,
|
|
wdPaperA4 = 7,
|
|
wdPaperA4Small = 8,
|
|
wdPaperA5 = 9,
|
|
wdPaperB4 = 10,
|
|
wdPaperB5 = 11,
|
|
wdPaperCSheet = 12,
|
|
wdPaperDSheet = 13,
|
|
wdPaperESheet = 14,
|
|
wdPaperFanfoldLegalGerman = 15,
|
|
wdPaperFanfoldStdGerman = 16,
|
|
wdPaperFanfoldUS = 17,
|
|
wdPaperFolio = 18,
|
|
wdPaperLedger = 19,
|
|
wdPaperNote = 20,
|
|
wdPaperQuarto = 21,
|
|
wdPaperStatement = 22,
|
|
wdPaperTabloid = 23,
|
|
wdPaperEnvelope9 = 24,
|
|
wdPaperEnvelope10 = 25,
|
|
wdPaperEnvelope11 = 26,
|
|
wdPaperEnvelope12 = 27,
|
|
wdPaperEnvelope14 = 28,
|
|
wdPaperEnvelopeB4 = 29,
|
|
wdPaperEnvelopeB5 = 30,
|
|
wdPaperEnvelopeB6 = 31,
|
|
wdPaperEnvelopeC3 = 32,
|
|
wdPaperEnvelopeC4 = 33,
|
|
wdPaperEnvelopeC5 = 34,
|
|
wdPaperEnvelopeC6 = 35,
|
|
wdPaperEnvelopeC65 = 36,
|
|
wdPaperEnvelopeDL = 37,
|
|
wdPaperEnvelopeItaly = 38,
|
|
wdPaperEnvelopeMonarch = 39,
|
|
wdPaperEnvelopePersonal = 40,
|
|
wdPaperCustom = 41
|
|
}
|
|
public partial class LBPages : LBComObjectList<LBPages, LBPage> /* Collection */
|
|
{
|
|
public LBPages(object item) => Item = item;
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
}
|
|
public enum LBWdViewType
|
|
{
|
|
wdNormalView = 1,
|
|
wdOutlineView = 2,
|
|
wdPrintView = 3,
|
|
wdPrintPreview = 4,
|
|
wdMasterView = 5,
|
|
wdWebView = 6,
|
|
wdReadingView = 7
|
|
}
|
|
public enum LBWdRevisionsView
|
|
{
|
|
wdRevisionsViewFinal = 0,
|
|
wdRevisionsViewOriginal = 1
|
|
}
|
|
public partial class LBZoom : LBComObject
|
|
{
|
|
public LBZoom() { }
|
|
public LBZoom(object item) : base(item) { }
|
|
public LBWdPageFit PageFit
|
|
{
|
|
get { return (LBWdPageFit)GetProperty("PageFit"); }
|
|
set { SetProperty("PageFit", value); }
|
|
}
|
|
public int Percentage
|
|
{
|
|
get { return (GetProperty("Percentage") as int? ?? 0); }
|
|
set { SetProperty("Percentage", value); }
|
|
}
|
|
}
|
|
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 => (GetProperty("Index") as int? ?? 0);
|
|
public LBColumn Next => new LBColumn(GetProperty("Next"));
|
|
public LBColumn Previous => new LBColumn(GetProperty("Previous"));
|
|
public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) => InvokeMethod("SetWidth", ColumnWidth, RulerStyle);
|
|
}
|
|
public enum LBWdRelativeHorizontalPosition
|
|
{
|
|
wdRelativeHorizontalPositionMargin = 0,
|
|
wdRelativeHorizontalPositionPage = 1,
|
|
wdRelativeHorizontalPositionColumn = 2,
|
|
wdRelativeHorizontalPositionCharacter = 3,
|
|
wdRelativeHorizontalPositionLeftMarginArea = 4,
|
|
wdRelativeHorizontalPositionRightMarginArea = 5,
|
|
wdRelativeHorizontalPositionInnerMarginArea = 6,
|
|
wdRelativeHorizontalPositionOuterMarginArea = 7
|
|
}
|
|
public enum LBWdRelativeVerticalPosition
|
|
{
|
|
wdRelativeVerticalPositionMargin = 0,
|
|
wdRelativeVerticalPositionPage = 1,
|
|
wdRelativeVerticalPositionParagraph = 2,
|
|
wdRelativeVerticalPositionLine = 3,
|
|
wdRelativeVerticalPositionTopMarginArea = 4,
|
|
wdRelativeVerticalPositionBottomMarginArea = 5,
|
|
wdRelativeVerticalPositionInnerMarginArea = 6,
|
|
wdRelativeVerticalPositionOuterMarginArea = 7
|
|
}
|
|
public enum LBWdPageFit
|
|
{
|
|
wdPageFitNone = 0,
|
|
wdPageFitFullPage = 1,
|
|
wdPageFitBestFit = 2,
|
|
wdPageFitTextFit = 3
|
|
}
|
|
public enum LBWdRulerStyle
|
|
{
|
|
wdAdjustNone = 0,
|
|
wdAdjustProportional = 1,
|
|
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 bool Visible
|
|
{
|
|
get { return (GetProperty("Visible") as bool? ?? 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() { }
|
|
public LBCell(object item) : base(item) { }
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public LBRange Range => new LBRange(GetProperty("Range"));
|
|
public LBColumn Column => new LBColumn(GetProperty("Column"));
|
|
public LBCell Next => new LBCell(GetProperty("Next"));
|
|
public LBCell Previous => new LBCell(GetProperty("Previous"));
|
|
public LBRow Row => new LBRow(GetProperty("Row"));
|
|
public LBWdCellVerticalAlignment VerticalAlignment
|
|
{
|
|
get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); }
|
|
set { SetProperty("VerticalAlignment", value); }
|
|
}
|
|
public float Width
|
|
{
|
|
get { return (GetProperty("Width") as float? ?? 0); }
|
|
set { SetProperty("Width", value); }
|
|
}
|
|
public float Height
|
|
{
|
|
get { return (GetProperty("Height") as float? ?? 0); }
|
|
set { SetProperty("Height", value); }
|
|
}
|
|
// C2019-021 RHM 5/15/2019 Added newe methods and properties for Import Word Content
|
|
public int RowIndex => (GetProperty("RowIndex") as int? ?? 0);
|
|
public int ColumnIndex => (GetProperty("ColumnIndex") as int? ?? 0);
|
|
public LBTables Tables => new LBTables(GetProperty("Tables"));
|
|
public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) => InvokeMethod("SetWidth", ColumnWidth, RulerStyle);
|
|
}
|
|
public enum LBWdSaveFormat
|
|
{
|
|
wdFormatDocument = 0,
|
|
wdFormatTemplate = 1,
|
|
wdFormatText = 2,
|
|
wdFormatTextLineBreaks = 3,
|
|
wdFormatDOSText = 4,
|
|
wdFormatDOSTextLineBreaks = 5,
|
|
wdFormatRTF = 6,
|
|
wdFormatUnicodeText = 7,
|
|
wdFormatHTML = 8,
|
|
wdFormatWebArchive = 9,
|
|
wdFormatFilteredHTML = 10,
|
|
wdFormatXML = 11,
|
|
wdFormatXMLDocument = 12,
|
|
wdFormatXMLDocumentMacroEnabled = 13,
|
|
wdFormatXMLTemplate = 14,
|
|
wdFormatXMLTemplateMacroEnabled = 15,
|
|
wdFormatDocumentDefault = 16,
|
|
wdFormatPDF = 17,
|
|
wdFormatXPS = 18,
|
|
wdFormatFlatXML = 19,
|
|
wdFormatFlatXMLMacroEnabled = 20,
|
|
wdFormatFlatXMLTemplate = 21,
|
|
wdFormatFlatXMLTemplateMacroEnabled = 22,
|
|
wdFormatOpenDocumentText = 23
|
|
}
|
|
public enum LBWdFindMatch
|
|
{
|
|
wdMatchGraphic = 1,
|
|
wdMatchCommentMark = 5,
|
|
wdMatchTabCharacter = 9,
|
|
wdMatchCaretCharacter = 11,
|
|
wdMatchColumnBreak = 14,
|
|
wdMatchField = 19,
|
|
wdMatchNonbreakingHyphen = 30,
|
|
wdMatchOptionalHyphen = 31,
|
|
wdMatchNonbreakingSpace = 160,
|
|
wdMatchEnDash = 8211,
|
|
wdMatchEmDash = 8212,
|
|
wdMatchParagraphMark = 65551,
|
|
wdMatchFootnoteMark = 65554,
|
|
wdMatchEndnoteMark = 65555,
|
|
wdMatchManualPageBreak = 65564,
|
|
wdMatchAnyDigit = 65567,
|
|
wdMatchSectionBreak = 65580,
|
|
wdMatchAnyLetter = 65583,
|
|
wdMatchAnyCharacter = 65599,
|
|
wdMatchWhiteSpace = 65655
|
|
}
|
|
public enum LBWdReplace
|
|
{
|
|
wdReplaceNone = 0,
|
|
wdReplaceOne = 1,
|
|
wdReplaceAll = 2
|
|
}
|
|
public partial class LBPage : LBComObject
|
|
{
|
|
public LBPage() { }
|
|
public LBPage(object item) : base(item) { }
|
|
public int Height => (GetProperty("Height") as int? ?? 0);
|
|
public int Left => (GetProperty("Left") as int? ?? 0);
|
|
public LBRectangles Rectangles => new LBRectangles(GetProperty("Rectangles"));
|
|
public int Top => (GetProperty("Top") as int? ?? 0);
|
|
public int Width => (GetProperty("Width") as int? ?? 0);
|
|
}
|
|
public partial class LBRectangles : LBComObjectList<LBRectangles, LBRectangle> /* Collection */
|
|
{
|
|
public LBRectangles(object item)
|
|
{
|
|
Item = item;
|
|
}
|
|
public int Count
|
|
{
|
|
get { return (GetProperty("Count") as int? ?? 0); }
|
|
}
|
|
}
|
|
public partial class LBRectangle : LBComObject
|
|
{
|
|
public LBRectangle() { }
|
|
public LBRectangle(object item) : base(item) { }
|
|
public LBLines Lines => new LBLines(GetProperty("Lines"));
|
|
}
|
|
public partial class LBLines : LBComObjectList<LBLines, LBLine> /* Collection */
|
|
{
|
|
public LBLines(object item) => Item = item;
|
|
public int Count => (GetProperty("Count") as int? ?? 0);
|
|
}
|
|
public partial class LBLine : LBComObject
|
|
{
|
|
public LBLine() { }
|
|
public LBLine(object item) : base(item) { }
|
|
public int Top => (GetProperty("Top") as int? ?? 0);
|
|
public int Height => (GetProperty("Height") as int? ?? 0);
|
|
}
|
|
public enum LBWdMovementType
|
|
{
|
|
wdMove = 0,
|
|
wdExtend = 1
|
|
}
|
|
public enum LBWdUnits
|
|
{
|
|
wdCharacter = 1,
|
|
wdWord = 2,
|
|
wdSentence = 3,
|
|
wdParagraph = 4,
|
|
wdLine = 5,
|
|
wdStory = 6,
|
|
wdScreen = 7,
|
|
wdSection = 8,
|
|
wdColumn = 9,
|
|
wdRow = 10,
|
|
wdWindow = 11,
|
|
wdCell = 12,
|
|
wdCharacterFormatting = 13,
|
|
wdParagraphFormatting = 14,
|
|
wdTable = 15,
|
|
wdItem = 16
|
|
}
|
|
public enum LBWdGoToDirection
|
|
{
|
|
wdGoToAbsolute = 1,
|
|
wdGoToNext = 2,
|
|
wdGoToPrevious = 3,
|
|
wdGoToLast = -1
|
|
}
|
|
public enum LBWdGoToItem
|
|
{
|
|
wdGoToSection = 0,
|
|
wdGoToPage = 1,
|
|
wdGoToTable = 2,
|
|
wdGoToLine = 3,
|
|
wdGoToFootnote = 4,
|
|
wdGoToEndnote = 5,
|
|
wdGoToComment = 6,
|
|
wdGoToField = 7,
|
|
wdGoToGraphic = 8,
|
|
wdGoToObject = 9,
|
|
wdGoToEquation = 10,
|
|
wdGoToHeading = 11,
|
|
wdGoToPercent = 12,
|
|
wdGoToSpellingError = 13,
|
|
wdGoToGrammaticalError = 14,
|
|
wdGoToProofreadingError = 15,
|
|
wdGoToBookmark = -1
|
|
}
|
|
public partial class LBPictureFormat : LBComObject
|
|
{
|
|
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 => (GetProperty("ListLevelNumber") as int? ?? 0);
|
|
}
|
|
// C2019-021 Added new object type LBListFormat
|
|
public partial class LBListFormat : LBComObject
|
|
{
|
|
public LBListFormat() { }
|
|
public LBListFormat(object item) : base(item) { }
|
|
public string NameLocal
|
|
{
|
|
get { return (GetProperty("NameLocal").ToString()); }
|
|
set { SetProperty("NameLocal", value); }
|
|
}
|
|
public string ListString => (GetProperty("ListString").ToString());
|
|
}
|
|
}
|