Solved

saving page using OLECMDID_SAVE in webbrowser control

Posted on 1998-11-12
4
2,588 Views
Last Modified: 2012-06-27
I am creating a control that downloads a web page.  I use webbrowser control to do this job.  When the download of the page is completed, I would like to automatically save this page in a directory specified.  I tried to use following command: WebBrowser1.ExecWB OLECMDID_SAVE, OLECMDEXECOPT_DONTPROMPTUSER, "c:\temp"
This didn't work.  Only way I can get any kind of Save is using OLECMDID_SAVEAS.  Is this possbile using VB? Or do I need to look at VC++?
0
Comment
Question by:pkresge
  • 2
4 Comments
 
LVL 4

Expert Comment

by:idcanada
ID: 1444546

Alot of problems have came out with WebBrowser1.ExecWB method.
However, you code is okay, you just need to give the
WebBrowser Object the focus.

Not as easy as it sounds,
the setfocus will not also work.

Right now, your button that calls WebBrowser1.ExecWB has the focus.

0
 

Author Comment

by:pkresge
ID: 1444547
Even after I gave focus to the webbrowser control( MS Article ID: Q176400 ) the method didn't save the page.  Now I am looking at automating OLECMDID_SAVEAS with dialog window.  Is there a better way?
0
 
LVL 4

Accepted Solution

by:
idcanada earned 200 total points
ID: 1444548

With the dialog Window, all the use has to do is enter his filename and
bingo. File has been saved and at least he knows where it is.

Regards
0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1444549
Bought This Question.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

792 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