We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set font constatnly to entire word document using aspose.words?

iam importing html content in to current word document and merging current document to destination document.....iam not getting which font it is taking pls let me know how to check?

oDocBuilder = new DocumentBuilder(oCurrentDoc);

oDocBuilder.InsertHtml(sbHfnContent.ToString());

if (oCurrentDoc.ChildNodes.Count > 0)

{

oCurrentDoc.FirstSection.PageSetup.SectionStart = SectionStart.Continuous;

foreach (Section srcSection in oCurrentDoc)

{

Section newSection = (Section)oDestDoc.ImportNode(srcSection, true, ImportFormatMode.KeepSourceFormatting);

oDestDoc.Sections.Add(newSection);

}

}

Hi

Thanks for your request. Content inserted by Insert HTML does not inherit formatting specified in DocumentBuilder options. Whole formatting is taken from HTML snippet. If you insert HTML with no formatting specified, default formatting is used for inserted content.

Also if you looking to combine all formatting from the DocumentBuilder or another node automatically (like how InsertHtml behaved like in older versions) then you may want to look into using this code work around:

https://forum.aspose.com/t/53489

Also you can try using FontChanger class from this post to change a font for a whole document:

http://www.aspose.com/community/forums/162416/change-font/showthread.aspx#162416

//Open document

Document sourceDoc = new Document("in.doc");

// Create an object that inherits from the DocumentVisitor class.

FontChanger changer = new FontChanger("Arial");

//Get the model to accept a visitor.

// The model will iterate through itself by calling the corresponding methods

// on the visitor object (this is called visiting).

sourceDoc.Accept(changer);

//Save output document

sourceDoc.Save("out.doc");

Please let us know if you need more information, we will be glad to help you.

Best regards,