Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visisthebest on December 30, 2020, 11:28:05 AM

Title: Tip: how to get the shape size including its data graphics!
Post by: Visisthebest on December 30, 2020, 11:28:05 AM
Turns out Visio 2016 did have a nice hidden surprise for those of us who needed this functionality!

The Master.VisualBoundingBox method was introduced in Visio 2016:
https://docs.microsoft.com/en-us/office/vba/api/visio.master.visualboundingbox

with this argument:
visBBoxIncludeDataGraphics

https://docs.microsoft.com/en-us/office/vba/api/visio.visboundingboxargs

You can get the size of the shape with its data graphics included!

I asked a question about this in the forum some time ago, after which I considered writing a custom function to do this. Fortunately never got to it and happy to find Microsoft solved it for us.