R
Rich
I'm working in C#, framework v3.5. I've got a reference set to the Visio
11.0 Type Library. I need to be able to extract information about several
hundred shapes in a document. These shapes have about a dozen different
background fill colors.
From the SDK and some other blogs, etc. that been reading, it seems like the
following code should work...
Document doc1 = appVisio.ActiveDocument;
Page page = doc1.Pages[1];
foreach (Shape shape in page.Shapes)
{
Cell cell =
shape.get_CellsSRC((short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowFill,
(short)VisCellIndices.visFillBkgnd);
Console.WriteLine("Shape - ID: {0}\tColor: {1}",
shape.ID, cell.get_ResultStr(VisUnitCodes.visUnitsColor));
//aoother option: should yield the same result...
cell = shape.get_CellsU("FillBkgnd");
Console.WriteLine("Shape - ID: {0}\tColor: {1}",
shape.ID, cell.get_ResultStr(VisUnitCodes.visUnitsColor));
}
Code compiles cleanly and runs successfully. But all color values are
displayed as: "RGB(255, 255, 255)", which seemingly means whites.
Anybody know what I need to do?
Thanks in advance.
11.0 Type Library. I need to be able to extract information about several
hundred shapes in a document. These shapes have about a dozen different
background fill colors.
From the SDK and some other blogs, etc. that been reading, it seems like the
following code should work...
Document doc1 = appVisio.ActiveDocument;
Page page = doc1.Pages[1];
foreach (Shape shape in page.Shapes)
{
Cell cell =
shape.get_CellsSRC((short)VisSectionIndices.visSectionObject,
(short)VisRowIndices.visRowFill,
(short)VisCellIndices.visFillBkgnd);
Console.WriteLine("Shape - ID: {0}\tColor: {1}",
shape.ID, cell.get_ResultStr(VisUnitCodes.visUnitsColor));
//aoother option: should yield the same result...
cell = shape.get_CellsU("FillBkgnd");
Console.WriteLine("Shape - ID: {0}\tColor: {1}",
shape.ID, cell.get_ResultStr(VisUnitCodes.visUnitsColor));
}
Code compiles cleanly and runs successfully. But all color values are
displayed as: "RGB(255, 255, 255)", which seemingly means whites.
Anybody know what I need to do?
Thanks in advance.