Solved

Intercepting the "Save As..." dialog box from WebBrowser control....

Posted on 2002-07-17
3
178 Views
Last Modified: 2010-05-02
You know how when you navigate your webbrowser control to a downloadable file, the Save As dialog comes up?  Well here's what I need to do:

Instead of the save as dialog, I want the file to automatically be downloaded to a location that I specify in code.  OR the webbrowser can download the file and return the BYTES() to me in the code, and then I will write them out to a file.

So NO Save As dialog, everything will be handled in the code!

Please let me know if this is unclear!
Thanks,
Josh
0
Comment
Question by:jsm11482
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
AlonHirsch earned 75 total points
ID: 7159559
Hi,

This has been tried before with no luck.
The only way I can suggest that you overcome this is as follows :
Create a VB project that handles the entire HTTP protocol for you. You will then be responsible for the actual download and not the web browser.
AFAIK there is no way tooverride this functionality of IE using VB.

HTH,
Alon
0
 

Author Comment

by:jsm11482
ID: 7160482
Ok, that sucks, but here's what I did to get around it:

1) Set the WebBrowser to the web page that has a link to a downloadable file.

2) Get the source code from the WebBrowser
       strCode=Browser.Document.documentElement.innerhtml

3) Parse strCode for any HREF links.

4) Find the appropriate links that you want to download.

5) Use a WinInet control to get the file:
       Inet.OpenURL(Trim(strRemotePath), icByteArray)

6) Save the bytData array to a file!

Maybe this seudo-code will be useful to someone!

Thanks,
Josh
0
 

Author Comment

by:jsm11482
ID: 7160483
Too bad that it can't be done with ease, but I thank you for your answer!
-Josh
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now