better-simple-slideshow icon indicating copy to clipboard operation
better-simple-slideshow copied to clipboard

How to convert several word docs to PDF and then print the PDF (or the Word doc) to the local default printer?

Open lrfowler opened this issue 2 years ago • 0 comments
trafficstars

Hello... Can someone help with this?....I found a cool script to change several word docs in a folder to PDFs......... I just wish it could print the PDF (or word doc) to the default printer also... Here's the script I found: 'Convert .doc or .docx to .pdf files via Send To menu Set fso = CreateObject("Scripting.FileSystemObject") For i= 0 To WScript.Arguments.Count -1 docPath = WScript.Arguments(i) docPath = fso.GetAbsolutePathName(docPath) If LCase(Right(docPath, 4)) = ".doc" Or LCase(Right(docPath, 5)) = ".docx" Then Set objWord = CreateObject("Word.Application") pdfPath = fso.GetParentFolderName(docPath) & "" & _ fso.GetBaseName(docpath) & ".pdf" objWord.Visible = False Set objDoc = objWord.documents.open(docPath) objDoc.saveas pdfPath, 17 objDoc.Close objWord.Quit
End If
Next

lrfowler avatar Feb 17 '23 04:02 lrfowler