The following will open each document in a folder change to landscape
orientation and save as RTF format,leaving the original document in the
folder also..
Sub SaveAllAsRTF()
Dim FirstLoop As Boolean
Dim myFile As String
Dim strDocName As String
Dim PathToUse As String
Dim myDoc As Document
Dim Response As Long
PathToUse = InputBox("Path To Use?", "Path", "D:\My
Documents\Test\Versions\")
On Error Resume Next
Documents.Close SaveChanges:=wdPromptToSaveChanges
FirstLoop = True
myFile = Dir$(PathToUse & "*.doc")
While myFile <> ""
Set myDoc = Documents.Open(PathToUse & myFile)
If FirstLoop Then
With ActiveDocument
Selection.PageSetup.Orientation = wdOrientLandscape
End With
FirstLoop = False
Response = MsgBox("Do you want to process " & _
"the rest of the files in this folder", vbYesNo)
If Response = vbNo Then Exit Sub
Else
With ActiveDocument
Selection.PageSetup.Orientation = wdOrientLandscape
End With
End If
strDocName = ActiveDocument.FullName
intPos = InStrRev(strDocName, ".")
strDocName = Left(strDocName, intPos - 1)
strDocName = strDocName & ".rtf"
myDoc.SaveAs FileName:=strDocName, _
FileFormat:=wdFormatRTF
myDoc.Close SaveChanges:=wdDoNotSaveChanges
myFile = Dir$()
Wend
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>