none
在word中可以设置某一个段落的高度吗,如何实现? RRS feed

答案

  • 你好:

    Word本身并没有“段落高度”这个属性,但是倒是有段落之间的”行间距“属性,参考MSDN文档:

    ParagraphFormat.LineSpacing 属性 (Word)

    示例代码:

    using Microsoft.Office.Interop.Word;
        class Program
        {
            static void Main(string[] args)
            {
                Application app = new Application();
                app.Visible = true;
                Document doc = app.Documents.Open(@"D:\test.docx");
                Paragraph p=doc.Paragraphs[1];
                p.Format.LineSpacingRule = WdLineSpacing.wdLineSpaceExactly;
                p.Format.LineSpacing = 40;
                doc.Save();
                app.Quit();
            }
        }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    2015年5月8日 2:21
    版主

全部回复

  • office word中好像也没有这个属性, 要不你试试改变字体大小,行高这些?


    2015年5月7日 2:55
  • 你好:

    Word本身并没有“段落高度”这个属性,但是倒是有段落之间的”行间距“属性,参考MSDN文档:

    ParagraphFormat.LineSpacing 属性 (Word)

    示例代码:

    using Microsoft.Office.Interop.Word;
        class Program
        {
            static void Main(string[] args)
            {
                Application app = new Application();
                app.Visible = true;
                Document doc = app.Documents.Open(@"D:\test.docx");
                Paragraph p=doc.Paragraphs[1];
                p.Format.LineSpacingRule = WdLineSpacing.wdLineSpaceExactly;
                p.Format.LineSpacing = 40;
                doc.Save();
                app.Quit();
            }
        }


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    2015年5月8日 2:21
    版主