Group:  Microsoft Word ยป microsoft.public.word.pagelayout
Thread: page setup to adjust margin without changing orientation

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

page setup to adjust margin without changing orientation
xppuser 05.07.2006 18:50:02
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
Re: page setup to adjust margin without changing orientation
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 06.07.2006 00:46:18
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

"xppuser" <xppuser[ at ]discussions.microsoft.com> wrote in message
news:E3126A05-89C5-42F9-BDDD-645E7F429F88[ at ]microsoft.com...
[Quoted Text]
> 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


Re: page setup to adjust margin without changing orientation
xppuser 06.07.2006 09:15:02
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

"Doug Robbins - Word MVP" wrote:

[Quoted Text]
> 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
>
> "xppuser" <xppuser[ at ]discussions.microsoft.com> wrote in message
> news:E3126A05-89C5-42F9-BDDD-645E7F429F88[ at ]microsoft.com...
> > 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
>
>
>
Re: page setup to adjust margin without changing orientation
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 15.07.2006 15:06:07
See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at:

http://www.word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm


--
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

"xppuser" <xppuser[ at ]discussions.microsoft.com> wrote in message
news:FB42BE5C-51C9-4AD0-ACE3-75B637C9E1BC[ at ]microsoft.com...
[Quoted Text]
> 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
>
> "Doug Robbins - Word MVP" wrote:
>
>> 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
>>
>> "xppuser" <xppuser[ at ]discussions.microsoft.com> wrote in message
>> news:E3126A05-89C5-42F9-BDDD-645E7F429F88[ at ]microsoft.com...
>> > 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
>>
>>
>>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net