「Web アーカイブ、単一のファイル (*.mht)」で「名前を付けて保存」する。
IE7では、「名前を付けて保存」のデフォルトが「Web アーカイブ、単一のファイル (*.mht)」なので、わざわざ作る意味がありませんが、IE6用に。
とは言っても、IE6なら、わざわざコンテキストメニュー拡張にする必要はないのですが。。。
SaveAsMHTML.htm
<html>
<head>
<object id=ShellWindows classid=clsid:9BA05972-F6A8-11CF-A442-00A0C90A8F39></object>
<object id=fso classid=clsid:0D43FE01-F093-11CF-8940-00A0C9054228></object>
<script language=jscript defer></script>
<script language=vbscript defer>
For Each ie In ShellWindows
If TypeName(ie.Document)="HTMLDocument" Then
If ie.Document.parentWindow Is external.menuArguments.top Then Exit For
End If
Next
title=ie.Document.title
If title="" Then
a1.href=ie.LocationURL
title=fso.GetFileName(decodeURI(a1.pathname))
End If
Select Case LCase(fso.GetExtensionName(title))
Case "mht","mhtml"
Case Else
title2=ie.Document.title
ie.Document.title=title & ".mht"
End Select
ie.ExecWB 4,1
If Not IsEmpty(title2) Then ie.Document.title=title2
</script>
</head>
<body>
<a id=a1 ></a>
</body>
</html>
SaveAsMHTML.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Web アーカイブ、単一のファイル(&M)]
@="C:\\どこか\\SaveAsMHTML.htm"
※ Vista IEの「保護モード:有効」のページでは使えません。
« 「Web ページ、完全 (*.htm;*.html)」で「名前を付けて保存」する。 | トップページ | ファイル名で「名前を付けて保存」する。 »