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

Free Support Forum - aspose.com

Couple Font Questions

Hi, I’m trying to use Words to mail merge info into different document templates. Is there any way to:

  1. Change the font of the entire document contents - the text in the document will have various formatting and sizes, but I want the font to be the same for the entire document and selectable by the user.

  2. Scale the font proportionately, so for example, increase all text by 30%?

Thanks for your help

Thanks for your inquiry. Yes of course you can change font of the whole document. You can use the following code to achieve this.

// Open document
Document doc = new Document(@"Test173\in.doc");
////Loop through all styles in the document
////And change formating 
foreach (Style style in doc.Styles)
    if (style.Font != null)
        style.Font.Size = 20;
        style.Font.Name = "Arial";
// Get collection of runs and set the same formating
NodeCollection runs = doc.GetChildNodes(NodeType.Run, true);
foreach (Run run in runs)
    run.Font.Size = 20;
    run.Font.Name = "Arial";

You can use the same technique to change font size.
Best regards.