Visio Guy

Visio Discussions => Programming & Code => Topic started by: mmulvenna on May 22, 2008, 12:47:11 PM

Title: Update Alignment box
Post by: mmulvenna on May 22, 2008, 12:47:11 PM
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.


Thanks in advance
Title: Re: Update Alignment box
Post by: Visio Guy on May 22, 2008, 01:05:57 PM
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
Title: Re: Update Alignment box
Post by: mmulvenna on May 22, 2008, 01:22:36 PM

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