Checking the total size of a shape including its data graphics in VBA

Started by Visisthebest, June 02, 2020, 04:39:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

What is the best way with VBA to check the total width and height of a shape including the data graphics that were added on to the shape?

(typically the shapes I use are group shapes with subshapes, I add the data graphics only to the group shape)

Hope this is easy to do, a little fearful it may be complicated.

Visio 2021 Professional

wapperdude

Your description is kinda vague.

By itself, the Data Graphic is not included withing the bounding box of the group.  So, it alone would require code.  Assuming that your group shape is assembled using normal methodology, that is, all shapes are withing the bounding box of the group, that allows it's dimensions to cover all of the subshapes.  The code would have to iterate thru the group, find the Data Graphic shape, get it's size and location relative to the group, do a little math, and combine the results.  It the group shape has subshapes that are located fully/partially outside the group boundry, then things become bit more complex.
Visio 2019 Pro

Visisthebest

Yes sorry but your answer is clear thank you Wapperdude, not so easy unfortunately but happy there is a good solution thank you!
Visio 2021 Professional