How to get Visio ShapeData information with C#?
I am a programmer and I am facing a problem while using the Visio document. I am writing my codes on c# and using custom templates, stencils, and masters of Visio document.
I am coding a programmed that will take Shape Data information (properties, labels, values, prompts, etc.) and/or external data information of a shape on my chosen template.
During my work I dropped the shapes on a Visio 2007 page and I can get which shapes are on the pre-defined page.
However, I can’t find a workaround to take the properties of a shape on my code in C#.
Code:
Visio.Page visioPage2 = this.Application.ActivePage;
////
int shapeCount2 = visioPage2.Shapes.Count;
for (int i = 1; i < shapeCount2; i++)
{
shapenameArray[i] = visioPage2.Shapes[i].Name;
shapepromptArray[i] = visioPage2.Shapes[i].Master.Prompt;
string data1 = visioPage2.Shapes[i].Data1;
string data2 = visioPage2.Shapes[i].Data2;
string data3 = visioPage2.Shapes[i].Data3;
string text = visioPage2.Shapes[i].Text;
short type = visioPage2.Shapes[i].Type;
int id = visioPage2.Shapes[i].ID;
shapeinfoArray[i] = visioPage2.Shapes[i].MasterShape.Text;
string property = visioPage2.Shapes[i].get_Cells("Prop.NameOfProperty").Formula;
}
////
The code above gives me the shape prompt value however no label names, values or types are noticed for the Shape Data defined on Vision.
I shall be very thankful to you if give your expert opinions on this issue.








