Author Topic: Update Alignment box  (Read 5412 times)

0 Members and 1 Guest are viewing this topic.


  • Full Member
  • ***
  • Posts: 91
Update Alignment box
« 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
« Last Edit: May 22, 2008, 01:09:25 PM by mmulvenna »

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1723
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Update Alignment box
« Reply #1 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
« Last Edit: May 22, 2008, 01:09:24 PM by Visio Guy »
For articles, tips and free content, see the Visio Guy Website at
Get my Visio Book! Using Microsoft Visio 2010


  • Full Member
  • ***
  • Posts: 91
Re: Update Alignment box
« Reply #2 on: May 22, 2008, 01:22:36 PM »

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