Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2002-07-17
3
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
AlonHirsch earned 300 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

670 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