Using the below code the heading that is in before.docx comes though as Arial. In the after.docx it has become Times New Roman.
Using Aspose.Words 14.3
var doc = new Aspose.Words.Document();
Paragraph paragraph = new Paragraph(doc);
paragraph.ParagraphFormat.StyleIdentifier = StyleIdentifier.Heading2;
paragraph.AppendChild(new Run(doc, “Test”));
Paragraph paragraph2 = new Paragraph(doc);
paragraph2.AppendChild(new Run(doc, “Test2”));
doc.FirstSection.Body.AppendChild(paragraph);
doc.FirstSection.Body.AppendChild(paragraph2);
doc.Save(@“c:\temp\before.docx”);
var builder = new Aspose.Words.DocumentBuilder(doc);
builder.MoveToDocumentEnd();
builder.InsertHtml(“
x
”); doc.Save(@“c:\temp\after.docx”);