Author Topic: Tip: how to get the shape size including its data graphics!  (Read 428 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Sr. Member
  • ****
  • Posts: 389
Tip: how to get the shape size including its data graphics!
« on: December 30, 2020, 06: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.
Visio 2021 Professional