Update Alignment box

Started by mmulvenna, May 22, 2008, 05:47:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mmulvenna

I have a group that as a result of code in the callthis function I add and/or delete shapes to the group. When I add shapes that change the size of the group the group alignment box is automatically updated. However when I delete those same shapes with the VBA code, the group alignment box for the group does not automatically update. I have checked the "update alignment box" in the group shapesheet but that has no effect.

If I use the menu shape/operations/update alignment box, the alignment box updates appropriately

I suspect that the group alignment box can be updated with a docmd function but I dont know what to function number to use?

Is it 1768? I will give that one a try.

Thoughts?

Thanks in advance
Mike

Visio Guy

#1
Hi Mike,

More Visio-oddity here. The UpdateAlignBox cell really only applies to the movement of Control Handles (little yellow diamonds) that a shape developer might have added to a shape. According the developer help:

"Recalculates the selection rectangle whenever a control handle is moved."

So, despite its name, the cell isn't really intended for what you need.

There is probably a DOCMD call that does what you need, but you would have to ensure that the shape in question was selected in the active window.

Since you are processing shapes in a CALLTHIS code function anyway, I think that calling shpGroup.UpdateAlignmentBox makes the most sense.

- Chris
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

mmulvenna

Chris,

Your suggestion worked perfectly. Once again thanks very much. ;D

Mike