Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matlab ActiveX command for PowerPoint Text Box Color
Date: Fri, 27 Jul 2007 15:01:44 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 15
Message-ID: <f8d1cn$qpi$1@fred.mathworks.com>
References: <f7lole$dhk$1@fred.mathworks.com> <f7mu4s$es5$1@fred.mathworks.com> <f88mi2$emd$1@fred.mathworks.com> <f899l5$rtt$1@fred.mathworks.com> <f8bfqh$ntj$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1185548504 27442 172.30.248.35 (27 Jul 2007 15:01:44 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 27 Jul 2007 15:01:44 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1062390
Xref: news.mathworks.com comp.soft-sys.matlab:421409



The RGB character string was being converted to an integer.  The integer was then being used as an index to all the RGB colors (256^3 or 0->16777215).  Here's how I corrected my problem and was able to get the correct text color for my textbox in PowerPoint.

    text_box=invoke(new_slide.Shapes,'AddTextbox','msoTextOrientationHorizontal', 259.25, 20.75, 200, 20);
    text_box.TextFrame.TextRange.Text='Hello';
    text_box.TextFrame.TextRange.Font.Size=8;
    text_box.TextFrame.TextRange.ParagraphFormat.Alignment = 'ppAlignCenter';
    text_box.TextFrame.TextRange.Font.Bold = 'msoFalse';
    %Convert RGB colors to an RGB color index
        RGBcolor=[255,0,255]; RGBcolor=rem(RGBcolor,256);
        RGBindex=RGBcolor(1)+RGBcolor(2)*256+RGBcolor(3)*65536;
    text_box.TextFrame.TextRange.Font.Color.RGB=RGBindex;


I hope this helps someone else out there.
Calves