我正在尝试在目录中打印文档,按文件名升序排列。我有下面的脚本来打印文件,它有效,但它的顺序是随机的。有没有办法根据名称对“文件”集合进行排序?
'Set the TargetFolder
TargetFolder = "C:\Temp\Hewitt\TestPrintFolder"
Set shellApplication = CreateObject("Shell.Application")
Set folder = shellApplication.Namespace(TargetFolder)
Set files = folder.Items
For Each file In files
file.InvokeVerbEx ("Print")
Next