Mokh Akh
Mokh Akh

Reputation: 431

How to set Outline Level programmatically

I try to set Outline Level for list, programmatically from code behind with Vsto C# enter image description here

Upvotes: 0

Views: 504

Answers (1)

haindl
haindl

Reputation: 3221

You can set the Outline Level using this code here:

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

The enum Microsoft.Office.Interop.Word.WdOutlineLevel contains all the levels that can be set.
(And maybe you should also add some additional error handling that fits your needs.)

Upvotes: 1

Related Questions