Saving a WebPage as MHT File

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Locked
David de Argentina
Posts: 1596
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina
Contact:

Saving a WebPage as MHT File

Post by David de Argentina »

This Function is very usefull for me:

Save as Save_MHT @ your function Folder

Code: Select all

{NeoBook Function}
Version=5.80
Language=VBScript
Param=[%2]|Text|FileName
Param=[%1]|Text|URL
Param=[%4]|Text|UserName (optional)
Param=[%5]|Text|PassWord (optional)
Param=[%3]|Text|Resources: 0=All, 1=None
{End}
Set objMsg = CreateObject("CDO.Message")
Set objStream = CreateObject("ADODB.Stream")
if "[%3]" = "0" Then
  objMsg.CreateMHTMLBody "[%1]", 0, "[%4]", "[%5]"
Else
  objMsg.CreateMHTMLBody "[%1]", 31, "[%4]", "[%5]"
End if
Set objStream = objMsg.GetStream
objStream.SaveToFile "[%2]", 2
Set objMsg = Nothing
Set objStream = Nothing
Resources means if you want save images/Objects/Links/Frames/BGSounds or not

Usage:

Code: Select all

Call "VBScript Examples\Save_MHT" "c:\webpage.mht" "http://neobook.com.ar/" "" "" "0"
My 0.01
David de Argentina
User avatar
dpayer
Posts: 1394
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Saving a WebPage as MHT File

Post by dpayer »

Very nice!

Thanks for sharing.

David P.
David Payer
Des Moines, Iowa
USA
Luiz Alfredo
Posts: 198
Joined: Thu Apr 19, 2007 6:58 am
Location: Brazil

Re: Saving a WebPage as MHT File

Post by Luiz Alfredo »

Very good. Thanks.
L.A.G.M.
User avatar
CN_Iceman
Posts: 300
Joined: Tue Mar 01, 2011 11:04 am
Location: España
Contact:

Re: Saving a WebPage as MHT File

Post by CN_Iceman »

Thank's for sharing.
Greetings/Saludos, Jose.
www.icemansoft.es
User avatar
chromebandit
Posts: 285
Joined: Wed Nov 24, 2010 5:00 pm
Contact:

Re: Saving a WebPage as MHT File

Post by chromebandit »

Nice one thank you!
Locked