From 161bb92059af20a4f4664b4ae1767d5d9e453c7e Mon Sep 17 00:00:00 2001 From: Kathy Date: Thu, 16 Jun 2011 10:25:28 +0000 Subject: [PATCH] --- PROMS/LBWordLibrary/LBComObject.cs | 68 +++++++++++++++++++++--- PROMS/LBWordLibrary/LBObjectExtension.cs | 2 +- 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/PROMS/LBWordLibrary/LBComObject.cs b/PROMS/LBWordLibrary/LBComObject.cs index da926933..ce49bd8f 100644 --- a/PROMS/LBWordLibrary/LBComObject.cs +++ b/PROMS/LBWordLibrary/LBComObject.cs @@ -292,12 +292,6 @@ namespace LBWordLibrary { get { return (GetProperty("SaveFormat") as int? ?? 0); } } - public Boolean Saved - { - get { return (GetProperty("Saved") as Boolean? ?? false); } - set { SetProperty("Saved", value); } - } - public String FullName { get { return (GetProperty("FullName").ToString()); } @@ -314,6 +308,11 @@ namespace LBWordLibrary { get { return new LBPageSetup(GetProperty("PageSetup")); } } + public Boolean Saved + { + get { return (GetProperty("Saved") as Boolean? ?? false); } + set { SetProperty("Saved", 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); @@ -932,6 +931,41 @@ namespace LBWordLibrary 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 enum LBWdOrientation { @@ -1185,4 +1219,26 @@ namespace LBWordLibrary public LBPictureFormat() { } public LBPictureFormat(Object item) : base(item) { } } + 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 + } } diff --git a/PROMS/LBWordLibrary/LBObjectExtension.cs b/PROMS/LBWordLibrary/LBObjectExtension.cs index 6b2724a5..987f00b4 100644 --- a/PROMS/LBWordLibrary/LBObjectExtension.cs +++ b/PROMS/LBWordLibrary/LBObjectExtension.cs @@ -269,7 +269,7 @@ namespace LBWordLibrary float retval = (float)myPages.Count - 1; LBRange myRange = Range(); myRange = myRange.GoTo(LBWdGoToItem.wdGoToPercent, LBWdGoToDirection.wdGoToLast, 100); - float partial = (float) myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); + float partial = (float) myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary); partial += myRange.Font.Size; retval += partial / 7200; return retval;