Page Resize

V

Viorel Farcas

Hello

Is there a way to move the page center to cover some selection. I am aware
of the command RsizeToFitContents but i only want the page to cover the
selected shapes.
I can get the selection's bounding box.

Thanks
 
C

Chris Roth [ Visio MVP ]

You can manually do what you want by holding the Ctrl key and then mousing
over the edges of the paper - just like resizing a shape, but no green
handles.

I checked out the Visio event Monitor to see what Visio does when you grab
the sides of the page and resize. It changes the size of the page, then
changes the Pins of all the shapes on the page if the left or bottom sides
of the page were moved. In other words, Visio does it the hard way, so you
have to as well. You need to note how much you've changed the left(x) and
bottom(y) sides of the page and adjust all shapes by that much. Resizing the
top and right sides of the page won't effect pin coordinates for shapes on
the page.

Some other notes:

To figure out the size of the selection, use
visio.ActiveWindow.Selection.BoundingBox(args).

Check out the window methods: Get/SetViewRect and Get/SetWindowRect methods.
These allow you to map Visio page coordinates to what is displayed in the
window. That might also help you to some extent.

--

Hope this helps,

Chris Roth
Visio MVP
 
V

Viorel Farcas

Hello

Thank you .


Chris Roth said:
You can manually do what you want by holding the Ctrl key and then mousing
over the edges of the paper - just like resizing a shape, but no green
handles.

I checked out the Visio event Monitor to see what Visio does when you grab
the sides of the page and resize. It changes the size of the page, then
changes the Pins of all the shapes on the page if the left or bottom sides
of the page were moved. In other words, Visio does it the hard way, so you
have to as well. You need to note how much you've changed the left(x) and
bottom(y) sides of the page and adjust all shapes by that much. Resizing the
top and right sides of the page won't effect pin coordinates for shapes on
the page.

Some other notes:

To figure out the size of the selection, use
visio.ActiveWindow.Selection.BoundingBox(args).

Check out the window methods: Get/SetViewRect and Get/SetWindowRect methods.
These allow you to map Visio page coordinates to what is displayed in the
window. That might also help you to some extent.

--

Hope this helps,

Chris Roth
Visio MVP
 
S

Saritha

Hi Chris,
Is there any way to do like the page would be resized dynamically...whenever i'am dropping a control at the end,the page would be expanded automatically.
Thanks
Saritha.
 

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