Solved

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

Posted on 2002-07-17
3
177 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

19 Experts available now in Live!

Get 1:1 Help Now