Webページを印刷する。
IEで印刷がうまく行かないとき、代わりに印刷する方法です。
お気に入りに追加などして、インターネットショートカットを右クリック、印刷します。
あるいは、以下のスクリプトをデスクトップなどで作成してお気に入りまたはお気に入りバーに移動します。
お気に入りまたはお気に入りバーから実行します。
PrintHTML.vbs
Set Shell=CreateObject("Shell.Application")
For Each ie In Shell.Windows()
If ie.ReadyState=4 Then If TypeName(ie.Document)="HTMLDocument" Then If ie.Document.hasFocus() Then Exit For
Next
If IsEmpty(ie) Then
For Each ie In Shell.Windows()
If ie.ReadyState<>4 Then
ElseIf TypeName(ie.Document)="HTMLDocument" Then
ie.Document.focus
If ie.Document.hasFocus() Then Exit For
End If
Next
End If
If IsEmpty(ie) Then
MsgBox "Not Found"
WScript.Quit
End If
Shell.ShellExecute "rundll32.exe","mshtml.dll,PrintHTML """ & ie.locationURL & """"
« ファイル名にシフトJIS以外の文字があるか、VBSファイルで検出する。 | トップページ | IE9のアドレスバーに「javascript:~~~」を貼り付けると、「javascript:」が消える。 »