如何以编程方式设置大纲级别

时间:2016-11-27 22:38:24

标签: c# ms-word vsto

我尝试使用Vsto C#enter image description here

从代码中以编程方式为列表设置大纲级别

1 个答案:

答案 0 :(得分:1)

您可以在此处使用此代码设置大纲级别:

Application.ActiveDocument.Styles["MyStyle"].ParagraphFormat.OutlineLevel =
    WdOutlineLevel.wdOutlineLevel2;

枚举Microsoft.Office.Interop.Word.WdOutlineLevel包含可以设置的所有级别 (也许您还应该添加一些符合您需求的额外错误处理。)