L
LadySnowWhite
I’m writing a program to automatically draw Visio diagrams from data in a
database. As we update the database, hundreds of diagrams will be drawn. I
have used this example as a reference to get started:
http://msdn.microsoft.com/en-us/library/aa722522.aspx. So far the program is
working perfectly with an exception; I cannot edit the shapes I am using.
Even though I have told the program where to connect to the Visio template
that is holding the proper stencil, it does not seem to be reading the
correct shapes.
In the example, we call the shapes this way:
//declare shape
private const string _VisioItemMaster = “Itemâ€;
//Later in program, use shape
Visio.Master itemMaster = drawingPage.Document.Masters[Item];
In my program, I have changed the stencil, but Visio is not recognizing the
changes; it keeps placing default rectangles.
The auto help says that within the brackets, you need to place either the
NameUID or Index. How can I find a shape’s NameUID (it does not appear to be
the name in the Shape Sheet from Visio, or at least putting in that name
causes an object not found error), or how can I find the shape’s Index?
Putting in numbers 1 through 10 works without errors, but it does not place
the shapes that I want.
And how can I tell my program to connect to the right stencil to find my
shapes?
Here is how I connect to the template:
private const string _VisioTemplateName = "MyItemsSample.vst";
private const string _VisioStencilName = "MyStencilSample.vss";
The files are saved in the same location as my program and I have placed a
copy of the stencil in the Visio folder under my Program Files
database. As we update the database, hundreds of diagrams will be drawn. I
have used this example as a reference to get started:
http://msdn.microsoft.com/en-us/library/aa722522.aspx. So far the program is
working perfectly with an exception; I cannot edit the shapes I am using.
Even though I have told the program where to connect to the Visio template
that is holding the proper stencil, it does not seem to be reading the
correct shapes.
In the example, we call the shapes this way:
//declare shape
private const string _VisioItemMaster = “Itemâ€;
//Later in program, use shape
Visio.Master itemMaster = drawingPage.Document.Masters[Item];
In my program, I have changed the stencil, but Visio is not recognizing the
changes; it keeps placing default rectangles.
The auto help says that within the brackets, you need to place either the
NameUID or Index. How can I find a shape’s NameUID (it does not appear to be
the name in the Shape Sheet from Visio, or at least putting in that name
causes an object not found error), or how can I find the shape’s Index?
Putting in numbers 1 through 10 works without errors, but it does not place
the shapes that I want.
And how can I tell my program to connect to the right stencil to find my
shapes?
Here is how I connect to the template:
private const string _VisioTemplateName = "MyItemsSample.vst";
private const string _VisioStencilName = "MyStencilSample.vss";
The files are saved in the same location as my program and I have placed a
copy of the stencil in the Visio folder under my Program Files