A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Page Layout
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format several docs at once?



 
 
Thread Tools Display Modes
  #1  
Old April 23rd, 2009, 08:38 PM posted to microsoft.public.word.pagelayout
mrs_ruppel
external usenet poster
 
Posts: 1
Default Format several docs at once?

At work we have to run reports, export them, save them as Word documents, and
then reformat the page orientation to legal. Is there any way to do this to
several documents at once? I HATE having to open each document individually
and reformat one-by-one...
  #2  
Old April 24th, 2009, 07:42 AM posted to microsoft.public.word.pagelayout
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Format several docs at once?

It would certainly be possible to open a batch of folders and change the
page layout (see macro below), but it would probably be simpler to start off
with the reports in Legal format by basing the documents on a correctly
formatted template. How are the Word documents created?

Sub SaveAllAsLegal()
Dim strFileName As String
Dim strDocName() As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , "Legal Page Layout"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" Then strPath = strPath + "\"
End With

If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If

strFileName = Dir$(strPath & "*.doc")

While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc.PageSetup
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(14)
End With
oDoc.Close SaveChanges:=wdSaveChanges
strFileName = Dir$()
Wend
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


mrs_ruppel wrote:
At work we have to run reports, export them, save them as Word
documents, and then reformat the page orientation to legal. Is there
any way to do this to several documents at once? I HATE having to
open each document individually and reformat one-by-one...



  #3  
Old April 24th, 2009, 02:50 PM posted to microsoft.public.word.pagelayout
mrs_ruppel[_2_]
external usenet poster
 
Posts: 2
Default Format several docs at once?

We run the reports out of MOBIUS and then have to convert then from *.rpt* to
*.doc*. But I have to open them individually and reformat each to come up
landscape & legal.

"Graham Mayor" wrote:

It would certainly be possible to open a batch of folders and change the
page layout (see macro below), but it would probably be simpler to start off
with the reports in Legal format by basing the documents on a correctly
formatted template. How are the Word documents created?

Sub SaveAllAsLegal()
Dim strFileName As String
Dim strDocName() As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , "Legal Page Layout"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" Then strPath = strPath + "\"
End With

If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If

strFileName = Dir$(strPath & "*.doc")

While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc.PageSetup
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(14)
End With
oDoc.Close SaveChanges:=wdSaveChanges
strFileName = Dir$()
Wend
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


mrs_ruppel wrote:
At work we have to run reports, export them, save them as Word
documents, and then reformat the page orientation to legal. Is there
any way to do this to several documents at once? I HATE having to
open each document individually and reformat one-by-one...




  #4  
Old April 24th, 2009, 03:24 PM posted to microsoft.public.word.pagelayout
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Format several docs at once?

OK, for landscape you will need to swap the height and width in the macro
thus

With oDoc.PageSetup
.PageWidth = InchesToPoints(14)
.PageHeight = InchesToPoints(8.5)
End With

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



mrs_ruppel wrote:
We run the reports out of MOBIUS and then have to convert then from
*.rpt* to *.doc*. But I have to open them individually and reformat
each to come up landscape & legal.

"Graham Mayor" wrote:

It would certainly be possible to open a batch of folders and change
the page layout (see macro below), but it would probably be simpler
to start off with the reports in Legal format by basing the
documents on a correctly formatted template. How are the Word
documents created?

Sub SaveAllAsLegal()
Dim strFileName As String
Dim strDocName() As String
Dim strPath As String
Dim oDoc As Document
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

With fDialog
.Title = "Select folder and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show -1 Then
MsgBox "Cancelled By User", , "Legal Page Layout"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) "\" Then strPath = strPath + "\"
End With

If Documents.Count 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If

strFileName = Dir$(strPath & "*.doc")

While Len(strFileName) 0
Set oDoc = Documents.Open(strPath & strFileName)
With oDoc.PageSetup
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(14)
End With
oDoc.Close SaveChanges:=wdSaveChanges
strFileName = Dir$()
Wend
End Sub

http://www.gmayor.com/installing_macro.htm


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


mrs_ruppel wrote:
At work we have to run reports, export them, save them as Word
documents, and then reformat the page orientation to legal. Is
there any way to do this to several documents at once? I HATE
having to open each document individually and reformat one-by-one...



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.