1

Closed

Styles Heading2 is not recognized

description

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 = Alignment.center;
Closed Jul 7, 2016 at 10:11 AM by MadBoy

comments

shaunjensen wrote Jul 6, 2016 at 10: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 10:10 AM

Glad you solved it ;-)

wrote Jul 7, 2016 at 10:11 AM