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

Free Support Forum - aspose.com

Unable to set Font Bold

I am able to change the color, font, size and text of a portion, but the FontBold property always remains false. Is there a way to format sections of text as bold?

I am evaluating Slides.Net 2.9, language is C# and looking to purchase ASAP.

Thanks.

Portion p = new Portion();

FontEntity fntEnt = pres.Fonts[0];

FontEntity fntEntNew = new FontEntity(pres, fntEnt);

fntEntNew.FontName = "Times New Roman";

int newFontIdx = pres.Fonts.Add(fntEntNew);

p.FontIndex = newFontIdx;

p.FontColor = ColorTranslator.FromHtml(sColor);

p.FontBold = true;

p.Text = pText;

portions.Add(p);

I've discovered that after a portion is added to the portions collection then the FontBold property is allowed to be changed. Is this by design or shoud a portion be able to be formatted and then added to the portions collection retaining all the settings?

Portion p = new Portion();

FontEntity fntEnt = pres.Fonts[0];

FontEntity fntEntNew = new FontEntity(pres, fntEnt);

fntEntNew.FontName = "Times New Roman";

int newFontIdx = pres.Fonts.Add(fntEntNew);

p.FontIndex = newFontIdx;

p.FontColor = ColorTranslator.FromHtml(sColor);

p.Text = "some text";

portions.Add(p);

portions[portions.Count - 1].FontBold = true;

Hello,

That is by design of PPT format.
Properties of paragraph and portion valid (and can be changed) only after adding these objects
to a presentation because most of properties inherited or depend on master slides.