addSection error in VBS

R

rodionos

Hello,

My environment is Visio 2007 12.0.6423.1000 SP2 and I am trying to add a
custom property from a vbs file:

The following code fails with 'bad or missing index':

Set vsoShape = actPage.DrawRectangle(1, 5, 5, 1)
vsoShape.AddSection visSectionProp

If I replace visSectionProp with 243 as specified in VisSectionIndices
Constants in SDK, the code works fine.

Set vsoShape = actPage.DrawRectangle(1, 5, 5, 1)
vsoShape.AddSection 243

Does anyone have a suggestion on how to make Visio constants work in a VBS
script?

Thanks,

Sergei
 
Top