Reading shape custom properties through the Visio API

A

Aaron Stibich

Another nube question here. I am trying to programmatically read the custom
properties of a shape. I found some examples, seemed simple enough, but I'm
not getting anything back, even on shapes that I know have custom properties
defined.

I am starting with a pointer to a window, that I get from the
'SelectionChanged' application event. I get the shape pointer out of the
window, then read the number of custom properties

lRows = spShape->GetRowCount( Visio::visSectionProp );

This always returns zero, and I know there are properties there (by looking
at the 'Custom Properties...' dialog in Visio). What am I missing here?

Thanks,

Aaron
 
L

LarryF

The value of a custom property named "MyProperty" can be accessed
through the cell named "Prop.MyProperty". Here's some C# code that does
this access. Your C++ will be different, but hopefully not too
different:

int val = spShape.getCells("Prop.MyProperty").get_ResultIU();
 

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