Getting Custom Properties

M

Marco Filippini

I'm writing an add-in in c#.
I need to get and set custom properties of document and shapes.
Does anybody know how to do it?

Thx in advance, Marco
 
M

Markus Breugst

Hi Marco,

hope the following example code helps.

Best regards,
Markus

-----.

IVShape vShape = ...;
IVSection vSection;

// create custom properties section, if not existent
if (vShape.get_SectionExists( (short) VisSectionIndices.visSectionProp, 1 )
== 0)
{
vShape.AddSection( (short) VisSectionIndices.visSectionProp );
}

// get custom property section
vSection = vShape.get_Section( (short) VisSectionIndices.visSectionProp );

// set custom property label (_index = row number)
vShape.get_CellsSRC( (short) VisSectionIndices.visSectionProp, (short)
((short) VisRowIndices.visRowProp + _index), (short)
VisCellIndices.visCustPropsLabel ).Formula = newLabel;

// set custom property value (_index = row number)
vShape.get_CellsSRC( (short) VisSectionIndices.visSectionProp, (short)
((short) VisRowIndices.visRowProp + _index), (short)
VisCellIndices.visCustPropsValue ).Formula = newValue;
 

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