在这里经常有人问起打印Web页面的问题,虽然有很多朋友都知道window.print()可以实现打印功能,但是功能不够完全,下面这个例子将会告诉你怎么实现完整的打印控制技术:
sub print
olecmd = 6 ' 打印命令
oleparam = 1
on error resume next
Printit.ExecWB olecmd, oleparam
if err.number <> 0 then
if DA then ' ie4的用户将退出打印
alert "打印不成功."
else ' ie3的用户将执行handle_error错误处理
handle_error
end if
end if
end sub

