This project has moved and is read-only. For the latest updates, please go here.


Styles Heading2 is not recognized


Although I see the style in the _Enumerations.cs file, when I set the StyleName to "Heading2" it is not recognized as heading 2 when i open it in word. My objective is not for formatting but to have my TOC recognize the heading2 sections like it does heading1. Here is the code I am using. If I change "Heading2" to "Heading1" it works as expected. Has anyone else experienced this? Thank you!
        Paragraph par = doc.InsertParagraph(chapter, false, HeaderFormat);
        par.StyleName = "Heading2";
        par.Alignment =;
Closed Jul 7, 2016 at 11:11 AM by MadBoy


shaunjensen wrote Jul 6, 2016 at 11:43 PM

The issue i was experiencing was because the "Heading2" style was not defined in my source document (a .dotx) file. When I added it explicitly in, both headings were recognized correctly

MadBoy wrote Jul 7, 2016 at 11:10 AM

Glad you solved it ;-)

wrote Jul 7, 2016 at 11:11 AM