Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lrfowler opened this issue Feb 17, 2023 · 0 comments

Comments

@lrfowler
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant