How to achieve "Size to fit drawing contents" functionality through VBA?

D

devendranath1979

HI,

I am generating Organization chart dynamically through VBA. But the
drawing paper size is not coming correctly. So i have to do following
steps manually for every chart.

Step1: Select "Page Setup" from File Menu. It opens "Page Setup"
window.
Step2: Select "Page Size" tab.
Step3: Select "Size to fit drawing contents" option.
Step4: Press "OK" button. Then the Visio will caluculate the Total
size (btoh width & height) of all visible shapes and assigns those
caluculated values to the page width and height.

Actually i recorded a macro for these steps. The total size (both
width & height) of all visible shapes is caluculated in background and
the resulted width and height are assigning to the document's width &
height. So please anybody help me, how to do that background
caluculation.

Thanks & regards
Devendra.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top