Sign in to follow this  
Followers 0
ToyBoi

IE save as

3 posts in this topic

so IE action can do save as but it doesn't seem to be able to save in a location that is a variable say $address , and if i use send("!f") ... etc , it also just saves it at the default location, in my case it's the desktop. how do i get it to save at the location that is $address?

Share this post


Link to post
Share on other sites



I am not sure if you are trying to save the page as html of if MHT is ok, but this is what I use to save a page as mht (one file for all resources and page):

;EXAMPLE:
;~ _INetGetMHT( "http://docs.phplivesupport.com/viewarticle.php?aid=76&pid=6&uid=1", "C:\IISandPHPonWin2K.MHT" )
Func _INetGetMHT( $url, $file )
    Local $msg = ObjCreate("CDO.Message")
    If @error Then Return False
    Local $ado = ObjCreate("ADODB.Stream")
    If @error Then Return False

    With $ado
        .Type = 2
        .Charset = "US-ASCII"
        .Open
    EndWith
    $msg.CreateMHTMLBody($url, 0)
    $msg.DataSource.SaveToObject($ado, "_Stream")
    FileDelete($file)
    $ado.SaveToFile($file, 1)
    $msg = ""
    $ado = ""
    Return True
EndFunc

Share this post


Link to post
Share on other sites

I am not sure if you are trying to save the page as html of if MHT is ok, but this is what I use to save a page as mht (one file for all resources and page):

;EXAMPLE:
;~ _INetGetMHT( "http://docs.phplivesupport.com/viewarticle.php?aid=76&pid=6&uid=1", "C:\IISandPHPonWin2K.MHT" )
Func _INetGetMHT( $url, $file )
    Local $msg = ObjCreate("CDO.Message")
    If @error Then Return False
    Local $ado = ObjCreate("ADODB.Stream")
    If @error Then Return False

    With $ado
        .Type = 2
        .Charset = "US-ASCII"
        .Open
    EndWith
    $msg.CreateMHTMLBody($url, 0)
    $msg.DataSource.SaveToObject($ado, "_Stream")
    FileDelete($file)
    $ado.SaveToFile($file, 1)
    $msg = ""
    $ado = ""
    Return True
EndFunc
hi thanks for the reply, so which variable is your custom location, and actualy, mht wouldn't work, it needs to be in either txt or html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0