[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

RE: Shape SetForeColor in c++

lgb35

12/15/2006 12:26:00 PM

Worked it out:

Shapes shapes = pSht->GetShapes();
ShapeRange shprng = shapes.AddShape(msoShapeRectangle, l, t, w, h);

FillFormat fill;
LineFormat line;
ColorFormat clr;

fill = shprng.GetFill();
clr = fill.GetForeColor();
clr.SetRgb(RGB(r, g, b);

line = shprng.GetLine();
line.SetVisible((long)0);


"lgb35" wrote:

> I'm struggling to work out how to set the forecolor (FillFormat) in a shape
> using C++ (Excel 2000 and 2003). The VBA is straightforward:
>
> ShapeRange.Fill.Visible = msoTrue
> ShapeRange.Fill.Solid
> ShapeRange.Fill.ForeColor.RGB = RGB(178, 197, 99)
>
> But the only member function available in C++ is GetFill(), and I can't see
> how to use it to modify the forecolor.
>
> Any ideas ?
>
> Thanks, Martin
>
>