I am appending HTML strings to paragraphs i create in a temporary section.
var p = tmpSection.AddParagraph();
p.AppendHTML("test without paragraph");
p.ApplyStyle(BuiltinStyle.Heading1);
p.Format.BeforeSpacing = 3;
p.Format.AfterSpacing = 3;
p = tmpSection.AddParagraph();
p.AppendHTML("<p>test with paragraph</p><p>test with paragraph</p>");
p.ApplyStyle(BuiltinStyle.Heading1);
p.Format.BeforeSpacing = 3;
p.Format.AfterSpacing = 3;
I notice that for the second part of the code where the HTML to append contains a paragraph or more, the Spacing Instructions are ignored. When i check in the resulting Word, the spacing is set to "Auto" instead of 3pt. For the first paragraph, the settings are set correctly.
I also notice that the style "Normal" is showing in Word, however, it is not really applied. Only if i press "Normal" style manually the formatting is adjusted.
Please help, i need to ensure consistent spacing if my html contains paragraphs or not.