You may also review the code below, but I consider it less reliable than the way I mentioned previously: key combination in SendKeys may depend on IE version, etc..
YSaveas(Your_URL,"HTML COMPLETE")
PROCEDURE YSaveas
PARAMETERS lcAddress, lcMode
IF TYPE("LCMODE")#"C" OR NOT INLIST(UPPER(lcmode),"MHT","HTML COMPLETE","HTML ONLY","TXT")
lcmode="MHT"
ENDIF
lcmode=UPPER(lcmode)
*lcaddress ="http://www.drudgereport.com/flashaot.htm"
DO case
CASE lcmode=="HTML COMPLETE"
lcoutfile = "c:\test.html"
CASE lcmode=="MHT"
lcoutfile = "c:\test.mht"
CASE lcmode=="HTML ONLY"
lcoutfile = "c:\test.html"
OTHERWISE
lcoutfile = "c:\test.txt"
ENDCASE
oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = .T.
CLEAR
oIE.Navigate(lcaddress)
lnstart=second()
do while type('OIE.DOCUMENT.title')#'C' and SECONDS()-lnstart<=15
WAIT WINDOW TIMEOUT 1.0 "Navigating...."
enddo
IF type('OIE.DOCUMENT.title')#'C'
?"Failed to navigate..."
return
endif
oShell = CreateObject("WScript.Shell")
lnstart=second()
do while not oShell.AppActivate(OIE.DOCUMENT.title) and ;
second()-lnstart <=10
wait wind time 1.0 "Entering ..."
?"attempt"
ENDDO
ERASE (lcoutfile)
if oShell.AppActivate(OIE.DOCUMENT.title)
oShell.SendKeys("%(fa)")
oShell.SendKeys(lcoutfile)
DO case
CASE lcmode=="HTML COMPLETE"
oShell.SendKeys("{TAB}{DOWN}")
CASE lcmode=="MHT"
oShell.SendKeys("{TAB}{DOWN}{DOWN}")
CASE lcmode=="HTML ONLY"
oShell.SendKeys("{TAB}{DOWN}{DOWN}{DOWN}")
OTHERWISE
oShell.SendKeys("{TAB}{DOWN}{DOWN}{DOWN}{DOWN}")
ENDCASE
oShell.SendKeys("{ENTER}%s")
WAIT WINDOW TIMEOUT 1.0 ""
?"OK"
ELSE
?"????"
endif
oIE.quit
oShell=null
Best Wishes,
Yuri Rubinov