'用VB保存网页到MHT文件
'代码: '引用:Microsoft CDO For Windows 2000 Library 和 Microsoft ActiveX Data Objects 2.x Library Private Function SavePageToMHT(ByVal URL As String,ByVal FileName As String) As Boolean Dim objMsg As New CDO.Message Dim objStream As ADODB.Stream On Error GoTo Err: objMsg.CreateMHTMLBody URL,"domain/username","password" Set objStream = objMsg.GetStream objStream.SaveToFile FileName,adSaveCreateOverWrite SavePageToMHT = True Exit Function Err: MsgBox Err.Description End Function '使用方法: 'SavePageToMHT "http://www.chenoe.com","C:/Home.mht" '注意:在URL中必须指定协议,比如上面的http。