Custom Properties

S

Scott Metzger

Hi,

How do I get Custom Properties (preferably with C++)?

Thanks,
Scott Metzger
 
S

Scott Metzger

Markus said:
Hi Scott,

see my reply to a thread titled "Getting Custom Properties", 10.07.2003,
question by "Marco Filippini".

Yes, I saw that.

What is VisSectionIndices.visSectionProp, and how do I get it ?
What is _index ?

I am using the C++ wrapper classes and have tried the following, but it
isn't getting me anything that looks like my Custom Properties.

CVisioShapes vsoShapes;
hrReturn = vsoPage.Shapes(vsoShapes);
check_valid(hrReturn, vsoShapes);

long numShapes;
vsoShapes.Count(&numShapes);
for (long i=1; i <= numShapes; i++)
{
CVisioShape vsoShape;
hrReturn = vsoShapes.Item(VVariant(i), vsoShape);
check_valid(hrReturn, vsoShapes);

for (int ii=1; ii<100; ii++)
{
for (int j=1; j<100; j++)
{
CVisioCell vCell;
vsoShape.CellsSRC(1, ii, j, vCell);
VBstr cell_name;
vsoShape.getNameU(cell_name);
}
}
}

Thanks,
Scott Metzger
 
M

Markus Breugst

Hello Scott,
What is VisSectionIndices.visSectionProp, and how do I get it ?
What is _index ?

That's a constant which specifies the index of the Custom Properties
Section. And I guess that this is the problem of your code.
I am using the C++ wrapper classes and have tried the following, but it
isn't getting me anything that looks like my Custom Properties.

Well, I am using the Microsoft Office Interop Assembly
(Microsoft.Office.Interop.Visio).
The constant mentioned above is available when including the assembly.

Our wrappers seem to have slightly different interfaces. Here is the C#
method for getting a cell value, to be invoked on a shape:

get_CellSRC( short section, short row, short column ).

Looking at your method call (where you obviously get the result as out
parameter), I guess the problem is that you don't use Visio's predefined
constants for addressing sections, rows, and columns. Instead, you iterate
through the rows and columns, using values from 1 .. n.

Example:

Adressing a section:
- VisSectionIndices.visSectionProp (for addressing the custom properties
section)

Addressing a column inside a section:
- VisCellIndices.visCustPropsValue (for addressing the "Value" column of the
CP section)
- VisCellIndices.visCustPropsLabel (for addressing the "Label" column of the
CP section)

(Note that every section has different column constants. This becomes clear
when looking into the shapesheet.)

Addressing a row inside a section:
- VisRowIndices.visRowProp + _index (where _index is a counter for iterating
through the rows)

I don't know the concrete names of these constants in your wrapper version,
but they should be somewhere.

Hope this information helps.

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