0

I am trying to set the color of a text in PPT from my C++ project.

The attribute TextRange->Font->Color cannot be modified ?!

I should feel much obliged if you can provide me any further help.

Thanks.

  • Possible duplicate of [How can I change the font color of a TextRange in PowerPoint from C#?](http://stackoverflow.com/questions/5247135/how-can-i-change-the-font-color-of-a-textrange-in-powerpoint-from-c) – o_weisman Jan 11 '16 at 16:57

1 Answers1

0

Font.Color is an object, not a property.

To change the color you need to change Font.Color.RGB to a long representing the color you want. Or change Font.Color.ObjectThemeColor to a long representing the index of the theme color you want.

Ah. But I'm speaking in VBA-tongues. My Longs are probably your Integers.

Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • Color is a property of Font. And it is a pointer to the object ColorFormat. [link](https://msdn.microsoft.com/EN-US/library/office/jj228306.aspx) The only two similar methods are : `void Putignorethis ( mso::MsoRGBType ignorethis );` Which I guess means, this functionality is not supported. And then: `void PutObjectThemeColor (enum mso::MsoThemeColorIndex ObjectThemeColor );` If I check the enum mso::MsoThemeColorIndex, I see that it is not what I am really looking for. – Zakaria Jaiathe Jan 12 '16 at 14:06
  • Most of the PowerPoint documentation on that site is incomplete, useless or just plain wrong. Sometimes all three. I wouldn't pay a great deal of attention to it. – Steve Rindsberg Jan 12 '16 at 16:38
  • Yes, it's true. My best documentation is to check by myself the decompiled API. – Zakaria Jaiathe Jan 13 '16 at 09:20