I have directories full of *.htm & *.html files, which I want to print
via MSIE (v6.0). The code that I have muddled thru currently will
open MSIE, displays the correct number of files in the directory that
I have dropped on the *.wsf, and then closes. However, it does not
print.
My code is:
<package>
<job>
<script language="vbscript">
dim fso, fldr, fldrs, fltag, mergelist,fc, nfc, x
set fso = createobject("scripting.filesystemobject")
set ie = createobject("internetexplorer.application")
set oWsh = createobject("wscript.shell")
set oArgs = wscript.arguments
fileerror = 0
on error resume next
if oArgs.count = 1 then
set fldrs = fso.getfolder(oArgs(0))
set fc = fldrs.files
ie.Visible = true
wscript.echo cstr(fc.count) + " files found."
for each fl in fc
on error resume next
if instr(ucase(fl.name), ".HTM") > 0 or instr(ucase(fl.name), ".HTML")
> 0 then
documents.open oArgs(0) + "\" + fl.name
if documents.count > 0 then
With documents.PageSetup
End With
with documents.PrintOptions
.outputtype = 1
.printcolortype = 2
.printinbackground = false
end with
documents.PrintOut
end if
documents.close
end if
next
end if
ie.quit
set ie = nothing
wscript.echo cstr(fileerror) + " errors."
</script>
</job>
</package>
I have no clue how to proceed. I get a LOT of *.htm & *.html files
that I need to print!
I'm used to Excel's VB, but this is a different ball of wax
altogether.
Thanks for any assistance y'all can provide!