Reply
 
Thread Tools Display Modes
  #1   Report Post  
CJ
 
Posts: n/a
Default Batch macro to change to A4

Hi, I need to change the page setuppaper size in several hundred docs to
A4. Is there a macro available from someone to help with this? Appreciate any
help.
Chuck
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

The following code should do it:

Dim MyPath As String
Dim MyFileName As String
Dim Source As Document

With Dialogs(wdDialogCopyFile)
If .Display() -1 Then Exit Sub
MyPath = .Directory
End With
If Len(MyPath) = 0 Then Exit Sub
If Asc(MyPath) = 34 Then
MyPath = Mid$(MyPath, 2, Len(MyPath) - 2)
End If
MyFileName = Dir$(MyPath & "*.doc")
While MyName ""
Set Source = Documents.Open(MyPath & myFile)
Source.PageSetup.PaperSize = wdPaperA4
Source.Save
Source.Close
MyName = 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
"CJ" wrote in message
...
Hi, I need to change the page setuppaper size in several hundred docs to
A4. Is there a macro available from someone to help with this? Appreciate
any
help.
Chuck



  #3   Report Post  
CJ
 
Posts: n/a
Default

Thanks for your help.
CJ

"Doug Robbins" wrote:

The following code should do it:

Dim MyPath As String
Dim MyFileName As String
Dim Source As Document

With Dialogs(wdDialogCopyFile)
If .Display() -1 Then Exit Sub
MyPath = .Directory
End With
If Len(MyPath) = 0 Then Exit Sub
If Asc(MyPath) = 34 Then
MyPath = Mid$(MyPath, 2, Len(MyPath) - 2)
End If
MyFileName = Dir$(MyPath & "*.doc")
While MyName ""
Set Source = Documents.Open(MyPath & myFile)
Source.PageSetup.PaperSize = wdPaperA4
Source.Save
Source.Close
MyName = 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
"CJ" wrote in message
...
Hi, I need to change the page setuppaper size in several hundred docs to
A4. Is there a macro available from someone to help with this? Appreciate
any
help.
Chuck




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 to change section headers and footers in a macro? PurbeckJohn Page Layout 0 July 18th 05 12:27 PM
Macro Button Won't Stay on Toolbar caleb Microsoft Word Help 2 June 14th 05 11:59 PM
Possible bug when recording a Word Macro Raven95 Microsoft Word Help 4 April 30th 05 09:49 PM
Change name of button that runs macro SWeyer Microsoft Word Help 4 April 29th 05 05:44 AM
2000 to 2002 macro and "Could not open macro storage" Art Farrell Mailmerge 1 December 6th 04 12:40 PM


All times are GMT +1. The time now is 08:13 AM.

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"