changing shape style

V

visDev

I want to change the linecolor, lineweight and fill color of visio shapes.
The following function does not work for rrow shapes and the color of other
shape is always changed to grey instead of red. Can someone tell me what's
wrong with this code? I am using visio sdk 2007, visual studio 2008 on vist
home premium (64 bit). I'll appreciate any help. Thanks in advance.

-vis_dev

private void ApplyHighlightStyle(string shapeId)
{
Shape shape =
drawingControl.Document.Pages[1].Shapes[shapeId];
shape.get_CellsSRC(
(short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionObject,
(short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowFill,
(short)Microsoft.Office.Interop.Visio.VisCellIndices.visFillForegnd).
ResultIU
= (double)Microsoft.Office.Interop.Visio.VisDefaultColors.visRed;

shape.get_CellsSRC(
(short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionObject,
(short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowFill,
(short)Microsoft.Office.Interop.Visio.VisCellIndices.visLineColor).ResultIU
= (double)Microsoft.Office.Interop.Visio.VisDefaultColors.visRed;

shape.get_CellsSRC(
(short)Microsoft.Office.Interop.Visio.VisSectionIndices.visSectionObject,
(short)Microsoft.Office.Interop.Visio.VisRowIndices.visRowFill,
(short)Microsoft.Office.Interop.Visio.VisCellIndices.visLineWeight).
ResultIU
= 19.0;
}

url:http://www.ureader.com/gp/1130-1.aspx
 
A

AlEdlund

Is it a simple shape, or a group shape? If a group shape are you cascading
the changes to the subshapes?
al
 
D

David J Parker [MVP Visio]

You need to set the formulaU not the resultiu
Also, it expects a string, so use a formula such as "=RGB(255,0,0)"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top