none
How can I set Text Color (and Background color) in PPT 2007 RRS feed

  • Question

  • Hi,

    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.
    Monday, January 11, 2016 4:22 PM

All replies

  • Hi Zakaria,

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

    It is enable to be modified. The document in MSDN seems not correct.

    Here is a simple code to set Color in VBA:

    With ActivePresentation.Slides(1).Shapes(1)
        With .TextFrame.TextRange.Font
            .Size = 48
            .Name = "Palatino"
            .Bold = True
            .Color.RGB = RGB(255, 127, 255)
        End With
    End With

    You could try similar code in C++.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, January 12, 2016 6:04 AM
  • Hi,

    Thanks for your answer Edward.
    It will not compile in C++ because I have checked, RGB is not a property of Color.
    I am using PPT 2007, maybe in the latest version this functionality is supported.

    All I can find under Color is:
    void Putignorethis (mso::MsoRGBType ignorethis );
    I guess, it means, this is not possible. However, I preferred to ask, maybe there is some alternative.

    • Edited by Zakaria Jaiathe Wednesday, January 13, 2016 9:32 AM HTML auto code
    Tuesday, January 12, 2016 2:16 PM
  • Hi Zakaria,

    To be honesty, I am not familiar with C++, so if there is any error in my post, please feel free to let me know.

    >> <g class="gr_ gr_50 gr-alert gr_gramm undefined Punctuation only-del replaceWithoutSep" data-gr-id="50" id="50">C++,</g> because I have checked, RGB is not a property of Color.
    Is this C++ code? Which project did you develop? Could you share us more information about your C++ project?

    >> I am using PPT 2007, maybe in the latest version this functionality is supported.
    Without PPT2007, I could not test with my above code, I will test it later and tell you result. Could you test your code under PPT2013?

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, January 13, 2016 9:16 AM
  • Hi Edward,

    the  piece of code around "C++" was added automatically when I posted my reply. It should be fine now.

    I am just building a small tool to generate ppt docs in a customized way. I am using MSPPT 2007 API.
    When I check, the decompiled API I couldn't find RGB property under ColorFormat object or any other similar method or attribute.

    I guess this functionality is just missing in 2007 API, maybe it is there in 2013 API.

    Kind regards.

    Zakaria


    Wednesday, January 13, 2016 9:42 AM
  • Hi Zakaria,

    As my test under PPT 2007, my above code worked correctly. I am not familiar with C++, could you share us a simple demo about your issue through OneDrive?

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, January 14, 2016 8:30 AM