Return LPI value before resetting.
This commit is contained in:
parent
0cf5331132
commit
73084c36eb
@ -55,18 +55,32 @@ namespace Volian.MSWord
|
|||||||
{
|
{
|
||||||
MyWordDoc.Close(false);
|
MyWordDoc.Close(false);
|
||||||
}
|
}
|
||||||
public void SetLineSpacing(float linesPerInch) // if need landscape set too: , bool landscape)
|
public float SetLineSpacing(float linesPerInch) // if need landscape set too: , bool landscape)
|
||||||
{
|
{
|
||||||
|
float retval = 0;
|
||||||
LBSelection selection = MyWordApp.Selection;
|
LBSelection selection = MyWordApp.Selection;
|
||||||
selection.WholeStory();
|
selection.WholeStory();
|
||||||
|
retval = selection.ParagraphFormat.LineSpacing;
|
||||||
selection.ParagraphFormat.SpaceBefore = 0;
|
selection.ParagraphFormat.SpaceBefore = 0;
|
||||||
selection.ParagraphFormat.SpaceAfter = 0;
|
selection.ParagraphFormat.SpaceAfter = 0;
|
||||||
selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly;
|
selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly;
|
||||||
selection.ParagraphFormat.LineSpacing = 72 / linesPerInch;
|
selection.ParagraphFormat.LineSpacing = 72 / linesPerInch;
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
public float Length
|
public float Length
|
||||||
{
|
{
|
||||||
get { return MyWordDoc.Length; }
|
get
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return MyWordDoc.Length;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Error Getting Length, {0}", ex.Message);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public static void CloseApp()
|
public static void CloseApp()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user