page setup to adjust margin without changing orientation

X

xppuser

hi all,

office pro 2003 sp2, wxp pro sp2,

i am in a predicament. i have a large document (~200+ and increasing) with
multiple sections and pages with either potrait and landscape oritentation,
with margins set at 2.5 cm for the four sides on A4 paper. now what i found
out, for some reasons, some pages have 'Letter' paper and yet another has odd
margins (default or some others e.g. 2.2 cm instead of 2.5 cm) settings. i do
not how it happens but it has happened to me in the past but with much
smaller document where i can just format the whole document to A4, set the
required margins, put on potrait, after which manually re-orientated
landscape pages where required. this is not feasible with this project.

my question is: is there a way to set the whole document to A4 with margins
2.5 cm for the four sides while at the same time preserving the pages'
orientation.

any help and advice would be appreciated. thank you.

regards,
jes
 
D

Doug Robbins - Word MVP

The following macro should change all of the pages to A4 and set the margins
to 2.5cm without changing the orientation. BUT, just in case things go
wrong. SAVE THE DOCUMENT BEFORE RUNNING THE MACRO.

Dim i As Long, Ornum As Long
With ActiveDocument
For i = 1 To .Sections.Count
With .Sections(i).PageSetup
Ornum = .Orientation
.PaperSize = wdPaperA4
.TopMargin = CentimetersToPoints(2.5)
.BottomMargin = CentimetersToPoints(2.5)
.LeftMargin = CentimetersToPoints(2.5)
.RightMargin = CentimetersToPoints(2.5)
.Orientation = Ornum
End With
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
X

xppuser

hi doug,

thank you for the codes. i would be grateful if you could tell me how to
deploy the macro. here are the first 2 sequence of steps that need to happen
(you'll need to guide me to the rest):

1. open the document that i want to apply the macro to
2. go to Tools -> Macros or is it VB Editor? please guide me from here on

i have opened the macros option (if that is the right one), which i think i
have to give the macro you gave me a name, click on Create, and then i
presumed save it somewhere and click run. i have opened the VB Editor too
where it shows Project Pane (on the left) and a blank screen on the right.

i hope you would be able to help me rather than giving up on me for lack of
knowledge of macros/VB. i am willing to give this a try.

thanks,
jes
 

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