GetShape by

T

Tamir Khason

How can I get shape on page (VisPage) by Name,Text ?
I have 2 shapes:
Name: 1234
Text: Test123

and

Name: 5678
Tried: Test456

I want to get them so
Visio.Shape visSourceShape = VisPage.Shapes["1234"]; // GET NOTHING

Visio.Shape visSourceShape = VisPage.Shapes[0]; // GET NOTHING AS WELL



How to get shape by name/id/text?
 
M

Markus Breugst

Hi Tamir,
I want to get them so
Visio.Shape visSourceShape = VisPage.Shapes["1234"]; // GET NOTHING

You should use the unique name of a shape, provided by the property NameID.
This unique name usually starts with "Sheet.", followed by a number, such as
"Sheet.123".
Visio.Shape visSourceShape = VisPage.Shapes[0]; // GET NOTHING AS WELL

As fas as I know, these lists start with index 1, not 0.

Best regards,
Markus
 
M

Markus Breugst

One important thing I forgot in my previous mail:

You should NEVER use this index stuff like "VisPage.Shapes["1234"]". This is
a non-supported part of the API and may result in strange results.
Better use the given wrapper methods instead, such as

_shape = _shapes.get_ItemU( _nameID );

Best regards,
Markus

Markus Breugst said:
Hi Tamir,
I want to get them so
Visio.Shape visSourceShape = VisPage.Shapes["1234"]; // GET NOTHING

You should use the unique name of a shape, provided by the property NameID.
This unique name usually starts with "Sheet.", followed by a number, such as
"Sheet.123".

Visio.Shape visSourceShape = VisPage.Shapes[0]; // GET NOTHING AS WELL

As fas as I know, these lists start with index 1, not 0.

Best regards,
Markus
 
T

Tamir Khason

O! That exact thing I ask, thank you... :)

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "


Markus Breugst said:
One important thing I forgot in my previous mail:

You should NEVER use this index stuff like "VisPage.Shapes["1234"]". This is
a non-supported part of the API and may result in strange results.
Better use the given wrapper methods instead, such as

_shape = _shapes.get_ItemU( _nameID );

Best regards,
Markus

Markus Breugst said:
Hi Tamir,
I want to get them so
Visio.Shape visSourceShape = VisPage.Shapes["1234"]; // GET NOTHING

You should use the unique name of a shape, provided by the property NameID.
This unique name usually starts with "Sheet.", followed by a number,
such
as
"Sheet.123".

Visio.Shape visSourceShape = VisPage.Shapes[0]; // GET NOTHING AS WELL

As fas as I know, these lists start with index 1, not 0.

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