Shape's Name bug?

Started by Mariachi41, August 17, 2011, 09:07:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I use C# to open a .vsd file and get shapes on one page. When I debug my code I find a problem, some shapes' Name property in the code is different from that I saw in the Format->Especial->Name. For example, one server shape's name is "server" in visio, but in the debug mode, it's "Sheet.2". This situation only appears in the "Net" template's shapes, and in other templates such as "Basic Flowchart", the code works well.

Anyone can help me with this? Thanks a lot.

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -



Dear Paul:

    I'v read the topics you gave, but I found my problem is different. Firstly, I only use default master of "Net" template; Secondly, in debug mode, I use a for cycle the get all the shapes, only the first shape's Name and NameU are normal, others' Name and NameU are both Sheet.X (X begin from 2).

    I've read Microsoft help document,  "If the shape is not an instance of a master, shapeName is Sheet followed by the shape's ID number. For example, Sheet.34. In this case, the Name and NameID properties of the shape return the same string." But I drag the shape from default stencil. So, WHY?


when you drop a shape on a page, visio will assign a default name to the object. The default name uses the form sheet.xx where xx is a number that is incremented, i.e. sheet.35 was dropped on the page after sheet.34. The number is the Id number, After the object is on the page you get the option (via code) to rename the object using Name and NameU.