Visio2003: NameID as Index?

M

Markus Breugst

Dear All,

in order to retrieve the reference of a specific shape out of a shape list,
it is possible to use the shape's "NameU", "ID", and "Index" value.
Example:
IVShape _shape = _document.Pages[1].Shapes[_id];

I don't know why, but we used the "NameID" value for this purpose. In
Visio2002 this worked perfect, but it seems that Visio2003 does not support
this anymore. Is this correct?

(Of course this is no problem. I just want to be sure that this is the
reason for some failures we have. Otherwise, I have to go on debugging.)

Thanks in advance & best regards,
Markus
 
M

Markus Breugst

I would like to define my problem in terms of an example. Please have a look
at the following code:

IVShapes _nativeShapes = _document.Pages[1].Shapes;
for (int i = 1; i <= _nativeShapes.Count; i++)
{
Console.WriteLine( _nativeShapes.NameID );
}
Console.WriteLine( this.nativeShapeNameID );
IVShape _nativeShape = _nativeShapes[this.nativeShapeNameID];

The loop shows me that there is a shape with NameID = "Sheet.1". This is the
same value as stored in
this.nativeShapeNameID.
Now my question: Why does the last line (_nativeShape = ...) throw an
exception telling me "unknown object name"?

As I said, it works fine in Visio2002, but it does not in Visio2003.

Best regards,
Markus
 

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