How to change the paper size for all pages?

M

miskiewicz2

Hi!

I have Visio 2007 Pro. I have a drawing with about 60 pages and I want
to change the paper size for all pages. For some reason Visio changes
the paper size for one page at a time only.

Thanks!
Thomas
 
J

John Goldsmith

Hello Thomas,

I'm afraid it's on a per page basis only. You could easily do this using
code though. Let me know if you're comfortable with a little VBA and what
size you want the pages to be and I'll give you an example if you like.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 
M

miskiewicz2

Hi John,
I'm afraid it's on a per page basis only. You could easily do this using
code though. Let me know if you're comfortable with a little VBA and what
size you want the pages to be and I'll give you an example if you like.


Thanks for you reply. Yes, I'm comfortable with a little VBA.

This is Visio 2007 Professional, right. This software is so
ridiculous! What's the big deal with adding a feature that changes the
paper size to all pages?


Thanks!

Thomas
 
J

John Goldsmith

Hello Thomas,

Have a go with the following:

Private Sub ChangeAllPageSizes()

Dim crntPage As Visio.Shape
Dim pag As Visio.Page

For Each pag In ActiveDocument.Pages
Set crntPage = pag.Shapes("thePage")
With crntPage
.Cells("PageWidth").FormulaU = "210mm"
.Cells("PageHeight").FormulaU = "297mm"
End With
Next pag
End Sub

This is some basic code to give you the idea. Bear in mind that you may
also want to change the Printed Page as well as the Drawing one, so change a
test page via the Page Setup dialog and then have a look at the ShapeSheet
behind the page you've just changed. All the cells you'll want to change in
code are right there.

I think I agree that some batch type functions in the UI would be useful,
but this type of code is extremely flexible.

Hope this helps.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 
K

Kobus Louw

Here is a very quick and easy way

Sub doit()
Dim O As Object
Dim i As Object

Set O = Application.ActiveDocument.Pages
For Each i In O
Application.ActiveWindow.Page = i
Application.ActiveWindow.Zoom = 1#
Next i
End Sub




miskiewicz wrote:

How to change the paper size for all pages?
15-Aug-07

Hi

I have Visio 2007 Pro. I have a drawing with about 60 pages and I wan
to change the paper size for all pages. For some reason Visio change
the paper size for one page at a time only

Thanks
Thomas

Previous Posts In This Thread:

How to change the paper size for all pages?
Hi

I have Visio 2007 Pro. I have a drawing with about 60 pages and I wan
to change the paper size for all pages. For some reason Visio change
the paper size for one page at a time only

Thanks
Thomas

Hello Thomas,I'm afraid it's on a per page basis only.
Hello Thomas

I'm afraid it's on a per page basis only. You could easily do this using
code though. Let me know if you're comfortable with a little VBA and what
size you want the pages to be and I'll give you an example if you like

Best regard

Joh

John Goldsmit
www.visualSignals.co.u


Hi John,Thanks for you reply. Yes, I'm comfortable with a little VBA.
Hi John


Thanks for you reply. Yes, I'm comfortable with a little VBA

This is Visio 2007 Professional, right. This software is s
ridiculous! What's the big deal with adding a feature that changes th
paper size to all pages

Thanks

Thomas

Re: How to change the paper size for all pages?
Hello Thomas

Have a go with the following

Private Sub ChangeAllPageSizes(

Dim crntPage As Visio.Shap
Dim pag As Visio.Pag

For Each pag In ActiveDocument.Page
Set crntPage = pag.Shapes("thePage"
With crntPag
.Cells("PageWidth").FormulaU = "210mm
.Cells("PageHeight").FormulaU = "297mm
End Wit
Next pa
End Su

This is some basic code to give you the idea. Bear in mind that you may
also want to change the Printed Page as well as the Drawing one, so change a
test page via the Page Setup dialog and then have a look at the ShapeSheet
behind the page you've just changed. All the cells you'll want to change in
code are right there

I think I agree that some batch type functions in the UI would be useful,
but this type of code is extremely flexible

Hope this helps

Best regard

Joh

John Goldsmit
www.visualSignals.co.u



Submitted via EggHeadCafe - Software Developer Portal of Choice
A Comparison of Managed Compression Algorithms
http://www.eggheadcafe.com/tutorial...arison-of-managed-compression-algorithms.aspx
 
B

Brittany Kimmons

John this code works perfect. I just tried it and had no issues. Is there a way to do this same thing but to change the print setup size for each sheet also?

Thank you!
 

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