Printing Many Word Documents in a Row

Regarding the article below: even without writing a script, you can print multiple Word files at once by selecting their icons with the mouse and choosing “right-click” – “Print”. ( ゚∀゚ )ノ

It is no longer necessary, but I will keep the article for the record.

———————–

When you have to print dozens to over a hundred Word files, opening them one by one is a pain. There seem to be free support tools, but they have to be installed and are no longer updated.

So I wrote a VBScript batch printing script. Actually, the original is here. The only changes are that it uses the current folder path and that it also handles .docx files.

Save the script below as “filename.vbs” and copy it into the folder containing the Word files you want to print. Double-click it in the folder to run batch printing.

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()

Dim objWshShell
Set objWshShell = WScript.CreateObject("WScript.Shell")

strComputer = "."
Set objWMIService = GetObject("winmgmts:\" & strComputer & "rootcimv2")

Set FileList = objWMIService.ExecQuery ("ASSOCIATORS OF {Win32_Directory.Name='" & objWshShell.CurrentDirectory & "'} Where " & "ResultClass = CIM_DataFile")

For Each objFile In FileList
 If objFile.Extension = "doc" Or objFile.Extension = "docx" Then
 objWord.PrintOut ,,,,,,,,,,,,objFile.Name
 End If
Next

objWord.Quit