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

Free Support Forum - aspose.com

How to download a word document with default font selection as black using aspose.words?

can we set default font to black in word document when downloading word document using aspose.words?every time i have to select text and applying color black to tht text...to avoid tht one

Aspose.Words.Document doc

System.IO.MemoryStream Ist = new System.IO.MemoryStream(oFormTemplate);

doc = new Aspose.Words.Document(Ist);


doc.Save(strfilename, Aspose.Words.SaveFormat.Docx);

System.IO.FileStream fs = new System.IO.FileStream(strfilename, System.IO.FileMode.Open, System.IO.FileAccess.Read);

byte[] ImageData = new byte[fs.Length];

fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length));

fs.Close();

System.IO.File.Delete(strfilename);

Response.Buffer = true;

Response.Clear();

Response.ClearContent();

Response.ClearHeaders();

Response.ContentType = "application/docx";

Response.AddHeader("Content-Disposition", "attachment;filename=wordTemplate.docx");

Response.BinaryWrite(ImageData);

Response.End();

Hello

Thanks for your request. Could you please be more specific regarding your problem? Please describe what you need to achieve in more detail way and I will try to help you.

To change font name/size/color you can try using FontChanger class as described here:

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

All that you need is modifying FontChanger in order to change font color.

Best regards,

after downloading when i open the word document its default font is set to red not black..

so how to download word document with default specific font to black...

Hello

Thank you for additional information. You should process this document using Aspose.Words befor downloading. To change font color you can try using FontChanger class as described here:

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

All that you need is modifying FontChanger in order to change font color.

Best regards,