geraldjr30b
Programmer
getting an "expected end of statement error. line 4. char 12"
not sure what to do. this vbscript is supposed to loop through word files in a path and save them as PDF.
please help
thanks in advance
not sure what to do. this vbscript is supposed to loop through word files in a path and save them as PDF.
please help
thanks in advance
Code:
'Option Explicit
Dim DRCTRY As String
DRCTRY = "U:\Test"
Dim fso, newFile, folder, files
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(DRCTRY )
Set files = folder.files
For Each file In files
Dim newName As String
newName = Replace(file.Path, ".doc", ".pdf")
Documents.Open FileName:=file.Path, _
ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
wdOpenFormatAuto, XMLTransform:=""
ActiveDocument.ExportAsFixedFormat OutputFileName:=newName, _
ExportFormat:=wdExportFormatPDF, OpenAfterExport:=False, OptimizeFor:= _
wdExportOptimizeForPrint, Range:=wdExportAllDocument, From:=1, To:=1, _
Item:=wdExportDocumentContent, IncludeDocProps:=True, KeepIRM:=True, _
CreateBookmarks:=wdExportCreateNoBookmarks, DocStructureTags:=True, _
BitmapMissingFonts:=True, UseISO19005_1:=False
ActiveDocument.Close
Next