开发者

vbscript: how to print multiple files with printer selection dialog once

开发者 https://www.devze.com 2023-01-13 02:24 出处:网络
I have to write vbscript that prints all files in a folder. Printer dialog should popup at the very beginning to allow user to 开发者_高级运维select printer to use. Than all files should be send to pr

I have to write vbscript that prints all files in a folder. Printer dialog should popup at the very beginning to allow user to 开发者_高级运维select printer to use. Than all files should be send to printer silently

How can I do that?

Thank you in advance!


Finally I produced something like this (simplified):

set objPrnDlg = CreateObject( "MSComDlg.CommonDialog" )
objPrnDlg.PrinterDefault = True
objPrnDlg.ShowPrinter

set objShell = CreateObject("Shell.Application") 
set objFolder = objShell.Namespace(path-to-files) 
set colItems = objFolder.Items 
for each objItem In colItems 
  objItem.InvokeVerbEx ("Print") 
next
0

精彩评论

暂无评论...
验证码 换一张
取 消