WebBrowser control

  • Thread starter Thread starter Newton Godoy
  • Start date Start date
N

Newton Godoy

Hi all,

I'm having some dificulties in using the webbrowser control to save an image
file which is displayed in the control. If someone could tell me what I'm
doing wrong it would be great.

I have the webbrowser wb2 in a form and using the navigate2 method I have
loaded a jpg image file. It works fine.
Now I am trying to save this image by executing:
Dim param() As Object = {"E:\VBDemos\Internet", "Test.jpg"}

wb2.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, param)

But there is no way to not prompt the user !

Maybe I am passing the param array in a wrong way. I really can't see what
can be wrong.

Any ideas ????

Thanks.
 
I'm pretty sure the browser will not let you do this, even when you specify
that no prompt should be displayed (IOW, that flag is ignored). I think I
remember this from the VB6 groups where it was a common problem. Have you
tried Google?
 
* "Newton Godoy said:
I'm having some dificulties in using the webbrowser control to save an image
file which is displayed in the control. If someone could tell me what I'm
doing wrong it would be great.

I have the webbrowser wb2 in a form and using the navigate2 method I have
loaded a jpg image file. It works fine.
Now I am trying to save this image by executing:
Dim param() As Object = {"E:\VBDemos\Internet", "Test.jpg"}

wb2.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, param)

But there is no way to not prompt the user !

Why not download the image file without loading it into the webbrowser
control?
 
Hi,

Let me explain why I am using this webbrowser to save images files. I
have two web brosers in my form. In the first one the user navigates to
any web page he wants, then I have code to get all the images in that
web page and add the src to a list box. Now when the user clicks an item
in the list box, the image is loaded in the second webbrowser and if he
wants to save it locally in his machine he clicks a button with code
similar to the one I am trying to make work. The problem is that it
seems that there is no way to avoid the user to be prompted with a Save
As dialog box, and if this message box is displayed I would have no way
to force all the images to be saved in the same folder and this is an
important requirement.
Maybe I will have to save it by other means.
Is it really impossible to stop the save as to be displayed ?
 
Hi Newton,

That "save as" is (was I have worked around it I thougth) is(was) for me a
problem also.

I thought that the documentation says that you can put that off, but I never
succeeded in that. So I have always thougth that I misreaded it.

Sorry I cannot help you with this.

Cor
 
Back
Top