Solved

saving page using OLECMDID_SAVE in webbrowser control

Posted on 1998-11-12
4
2,566 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

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
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…

896 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

12 Experts available now in Live!

Get 1:1 Help Now