#1   Report Post  
Posted to microsoft.public.word.docmanagement
Brie Brie is offline
external usenet poster
 
Posts: 8
Default change paper size

hi!

how to change the size of the paper of a group of word documents? say from
A4 to legal.

I have around 200 files and don't want to open them one by one.

thanks a bunch!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change paper size

A macro containing the following code would set the paper size to legal for
all of the documents in the C:\Test folder:

Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

PathToUse = "C:\Test\" 'Change the name of the folder to the one where all
of your documents are located.
'Close all open documents before beginning
Documents.Close SaveChanges:=wdPromptToSaveChanges
'Set the directory and type of file to batch process
myFile = Dir$(PathToUse & "*.doc")
While myFile ""
'Open document
Set myDoc = Documents.Open(PathToUse & myFile)
myDoc.PageSetup.PaperSize = wdPaperLegal
'Close the modified document after saving changes
myDoc.Close SaveChanges:=wdSaveChanges
'Next file in folder
myFile = Dir$()
Wend


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

"Brie" wrote in message
...
hi!

how to change the size of the paper of a group of word documents? say from
A4 to legal.

I have around 200 files and don't want to open them one by one.

thanks a bunch!



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Robert M. Franz (RMF) Robert M. Franz (RMF) is offline
external usenet poster
 
Posts: 1,741
Default change paper size

Hello Brie

Brie wrote:
how to change the size of the paper of a group of word documents? say from
A4 to legal.

I have around 200 files and don't want to open them one by one.


well, somebody or something has to open them, one by one. [Unless they
are in XML and you write code to run through that -- would probably work
faster, if you have the right devs at hand ... :-)]

Yes, code can do it for you. An example of a VBA routine that opens all
files in a given folder and "does something" (he a Replace run) can
be found he

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

If you can adjust this code to your needs or have somebody ready with
the right experience, it's faster. Otherwise, try one of the .word.vba
groups. Your code probably needs to loop through the sections collection
and adjust the page size in all of them.

0.2cents
Robert
--
/"\ ASCII Ribbon Campaign | MSFT |
\ / | MVP | Scientific Reports
X Against HTML | for | with Word?
/ \ in e-mail & news | Word | http://www.masteringword.eu/
  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Brie Brie is offline
external usenet poster
 
Posts: 8
Default change paper size

This is very helpful. Thanks Doug!

Brima

"Doug Robbins - Word MVP" wrote:

A macro containing the following code would set the paper size to legal for
all of the documents in the C:\Test folder:

Dim myFile As String
Dim PathToUse As String
Dim myDoc As Document

PathToUse = "C:\Test\" 'Change the name of the folder to the one where all
of your documents are located.
'Close all open documents before beginning
Documents.Close SaveChanges:=wdPromptToSaveChanges
'Set the directory and type of file to batch process
myFile = Dir$(PathToUse & "*.doc")
While myFile ""
'Open document
Set myDoc = Documents.Open(PathToUse & myFile)
myDoc.PageSetup.PaperSize = wdPaperLegal
'Close the modified document after saving changes
myDoc.Close SaveChanges:=wdSaveChanges
'Next file in folder
myFile = Dir$()
Wend


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

"Brie" wrote in message
...
hi!

how to change the size of the paper of a group of word documents? say from
A4 to legal.

I have around 200 files and don't want to open them one by one.

thanks a bunch!




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Brie Brie is offline
external usenet poster
 
Posts: 8
Default change paper size

Will look the .word.vba groups. to adjust the code - as you suggest Robert!
Afterall, I need to have some exercise for my brain.
Thanks a lot.

Brie


"Robert M. Franz (RMF)" wrote:

Hello Brie

Brie wrote:
how to change the size of the paper of a group of word documents? say from
A4 to legal.

I have around 200 files and don't want to open them one by one.


well, somebody or something has to open them, one by one. [Unless they
are in XML and you write code to run through that -- would probably work
faster, if you have the right devs at hand ... :-)]

Yes, code can do it for you. An example of a VBA routine that opens all
files in a given folder and "does something" (he a Replace run) can
be found he

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

If you can adjust this code to your needs or have somebody ready with
the right experience, it's faster. Otherwise, try one of the .word.vba
groups. Your code probably needs to loop through the sections collection
and adjust the page size in all of them.

0.2cents
Robert
--
/"\ ASCII Ribbon Campaign | MSFT |
\ / | MVP | Scientific Reports
X Against HTML | for | with Word?
/ \ in e-mail & news | Word | http://www.masteringword.eu/

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change default paper size Mungo Jerry Page Layout 8 August 10th 05 12:40 PM
How do I change paper size to 5.5 x 8.5? ruth bennett Page Layout 2 July 31st 05 11:31 PM
how do I change paper size in page setup wayne Page Layout 1 March 23rd 05 08:20 AM
How do I change default paper size Mungo Jerry Microsoft Word Help 5 February 28th 05 09:16 AM
how do I change paper size to A5 Carlp Page Layout 3 December 6th 04 09:41 PM


All times are GMT +1. The time now is 07:43 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"