shape reference

M

mike

I need to get a reference to a non-selected shape on a page, so that I can
compare custom properties between it and a selected shape, but I'm not having
any luck. I have the Name (or NameU) stored in a variable for use, but can't
figure out how to make it work.

There must be an easy(?) way to do this. Anyone know how?

Thanks...
 
P

Paul Herber

I need to get a reference to a non-selected shape on a page, so that I can
compare custom properties between it and a selected shape, but I'm not having
any luck. I have the Name (or NameU) stored in a variable for use, but can't
figure out how to make it work.

There must be an easy(?) way to do this. Anyone know how?

if the page object is in pagObj then the shape object shpObj
shpObj = pagObj.shapes[Name]
 
J

Jonathan Spane

Get the ActivePage then the Shapes on the page then the shape using that
name and using the Item method. The calls will be similar in Visual Basic
but I know the C++ way:. In C++ the API is UNICODE so you will have to
convert from char*.
CVisioPage activePage;
if(SUCCEEDED(m_visioApp.ActivePage(activePage)))

{
CVisioShapes shapes;
if(SUCCEEDED(activePage.Shapes(shapes)))

{
CVisioShape curShape;
if(SUCCEEDED(shapes.Item(VVariant(_T("your shape Name")), curShape)))
{
}
}
}
 
M

mike

That did the trick. Thanks!

Paul Herber said:
I need to get a reference to a non-selected shape on a page, so that I can
compare custom properties between it and a selected shape, but I'm not having
any luck. I have the Name (or NameU) stored in a variable for use, but can't
figure out how to make it work.

There must be an easy(?) way to do this. Anyone know how?

if the page object is in pagObj then the shape object shpObj
shpObj = pagObj.shapes[Name]
 

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