Sub ConvertWordFilesToPDF()
' Take all Word files from one directory and save them as PDF files in
' another directory.
Dim strFilename As String
Dim strWordDirectory As String
Dim strPDFDirectory As String
' Put the Word and PDF directory names here:
strWordDirectory = "I:\WORD\"
strPDFDirectory = "I:\PDF\"
' Get the name of the first Word file.
strFilename = strWordDirectory & "*.doc"
' Hide all the opening/closing of files from the user to speed things up
Application.ScreenUpdating = True
' Do this stuff as long as there's another filename read
Do While strFilename <> ""
' Change to the directory of Word files
ChangeFileOpenDirectory strWordDirectory
' Open the Word file
Documents.Open , FileName:=strFilename, ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
' Change to the directory of PDF files
ChangeFileOpenDirectory strPDFDirectory
' Save the Word file as an PDF file
ActiveDocument.SaveAs FileName:=Left(strFilename, Len(strFilename) -
4) & ".pdf", _
FileFormat:=wdFormatPDF, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="",
ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False,
SaveFormsData _
:=False, SaveAsAOCELetter:=False
' Close the file after saving in the new format
ActiveDocument.Close
' Read the next filename. If this returns "", the loop stops.
strFilename = Dir
Loop
' Let the user see what's going on again.
Application.ScreenUpdating = True
' Inform the user that we're done.
MsgBox ("All files converted to PDF files.")
End Sub
HTH
++++++++++++++++++++++++++++++++++++++++++++++++++
> In order to restore the lost toolbars/menus in Word 2007, I bought/installed
> ToolbarToggle - works fine <insert rejoicing here>.
[quoted text clipped - 25 lines]
> Mucho thanks - this area has been on the smartest things MS has come up
> with!!!