2012年7月23日 星期一

列印所顯示的網頁內容

<<方法1 -- 透過WebBrowserj物件來列印>>
// 附上常用指令
document.all.WebBrowser.ExecWB(1,1) //打開
document.all.WebBrowser.ExecWB(2,1) //關閉全部
document.all.WebBrowser.ExecWB(4,1) //另存為
document.all.WebBrowser.ExecWB(6,1) //列印
document.all.WebBrowser.ExecWB(6,6) //直接列印
document.all.WebBrowser.ExecWB(7,1) //預覽列印
document.all.WebBrowser.ExecWB(8,1) //頁面設置
document.all.WebBrowser.ExecWB(10,1) //屬性
document.all.WebBrowser.ExecWB(17,1) //全選
document.all.WebBrowser.ExecWB(22,1) //刷新
document.all.WebBrowser.ExecWB(45,1) //關閉


<<方法2 -- 透過JavaScript來列印>>
window.print();



其他詳細內容請看原始文章

沒有留言:

張貼留言