Dear Experts,
A webpage which I use has a pdf inside one of the frames. The frames name is: mainFrame. My goal is to save the file out of the frame onto my harddrive. How can I access it through the myExplorer.document.<?>
?
Normally, I would simply navigate to the url that is the innerframe, but in this case, that solution doesn't work. I'm not entirely sure why but I believe it's because the frame points to an asp page which in turn serves up the file.
Because of this I can't use URLDownloadToFile() either, because the url doesn't resolve to the file.
Other questions I really wanted to know, where since the frame is /loading/ another webpage, my waitForWeb() routine is failing, as it is testing for the other page to load (I think). How do I test for when the frame is done loading, so I know when the file is there?
Following is my routine for waiting on the web..
Public Sub waitForDoc2(ByRef mywebobj As shdocvw.InternetExplorer)
Dim counter, timeStart As Date, timeEnd As Date
timeStart = Now(): timeEnd = DateAdd("s", 15, timeStart)
On Error GoTo waitfordocerr
While mywebobj.Busy = True
DoEvents
Wend
Do
counter = counter + 1
If timeEnd > Now() Then Exit Do
DoEvents
Loop Until mywebobj.document.readySta
te = "complete" 'Or mywebobj.document.readySta
te = "interactive" And mywebobj.hwnd > 0
While mywebobj.document.body Is Nothing
counter = counter + 1
If counter > 5000 Then Exit Sub
DoEvents
Wend
Exit Sub
waitfordocerr:
myFuncs.pauseProgram 3
If Err.Description = "The remote server machine does not exist or is unavailable" Then
Err.Clear
Set mywebobj = New shdocvw.InternetExplorer
End If
End Sub
So, ideally, I would like to access it off my web object directly? And I need to know when it's finished loading. Any ideas?
Thanks! ~Michael
Start Free Trial