Free Support Forum - aspose.com

Themes

Hi



Please could you let me know how to apply paragraph styles and set the overall workbook theme via Aspose.



Thanks



Jared

Hi,

You mean MS Excel 2007 Themes feature in Page Layout menu packet, well, you should use your own code to apply style formatting (provided in themes) for cell shading colors, fonts and other attributes etc. using Aspose.Cells APIs.

We will look into the feature in our future versions though.

Thank you.

Hi Jared,

Thank you for considering Aspose.

Please try the attached version. We have supported to set style formatting with theme color. The following code shows how to set style formatting with theme color:

private static void UseThemeColor()

{

string outfn = _path + "UseThemeColor_out.xlsx";

Workbook workbook = new Workbook();

Cells cells = workbook.Worksheets[0].Cells;

Cell c = cells["D3"];

Style s = c.GetStyle();

s.ForegroundThemeColor = new ThemeColor(ThemeColorType.Accent2, 0.5);

s.Pattern = BackgroundType.Solid;

Font f = s.Font;

f.ThemeColor = new ThemeColor(ThemeColorType.Accent4, 0.1);

c.SetStyle(s);

c.PutValue("D3");

workbook.Save(outfn);

}

Thank You & Best Regards,