0
0rbital
I'm having an issue I need help on.
I have an indicator on a page called Indicator.91 with the ID being 91. I
want to set a shape to this indicator and change the color to green or red
depending on a value. Now the examples I've seen on how to get a shape by ID
number look like this:
// Get a shape by ID = 91:
Visio.Shape shp2 = (Visio.Page)viscontrol.Window.Page.Shapes.ItemFromID(91);
That gives me a compile error stating ItemFromID is not supported by the
language (Visio 2007 and .Net 2005 C#). So I have done it like this:
vsoPage = vsoApp.ActivePage;
shpZ8_604 = vsoPage.Shapes.get_ItemFromID(91);
shpZ8_604.get_Cells("FillForegnd").Formula = "RGB(0,255,0)";
That compiles fine and stepping through the code I see shpZ8_604 does in
fact get set to Indicator.91 but the fillForegnd (or FillBkgnd) line executes
fine but the color does not change. There's no protections set at this
point and I can right click and change the fill color of the indicator fine.
Any ideas?
I have an indicator on a page called Indicator.91 with the ID being 91. I
want to set a shape to this indicator and change the color to green or red
depending on a value. Now the examples I've seen on how to get a shape by ID
number look like this:
// Get a shape by ID = 91:
Visio.Shape shp2 = (Visio.Page)viscontrol.Window.Page.Shapes.ItemFromID(91);
That gives me a compile error stating ItemFromID is not supported by the
language (Visio 2007 and .Net 2005 C#). So I have done it like this:
vsoPage = vsoApp.ActivePage;
shpZ8_604 = vsoPage.Shapes.get_ItemFromID(91);
shpZ8_604.get_Cells("FillForegnd").Formula = "RGB(0,255,0)";
That compiles fine and stepping through the code I see shpZ8_604 does in
fact get set to Indicator.91 but the fillForegnd (or FillBkgnd) line executes
fine but the color does not change. There's no protections set at this
point and I can right click and change the fill color of the indicator fine.
Any ideas?