469,582 Members | 2,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,582 developers. It's quick & easy.

WebBrowser control

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.
Nov 20 '05 #1
6 4254
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?

--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Newton Godoy" <ne**********@aspect.com.au> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
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.

Nov 20 '05 #2
Cor
Hi Newton,

You can have a look for mshtml on MSDN, but it is a hard way to go.

Cor
Nov 20 '05 #3
* "Newton Godoy" <ne**********@aspect.com.au> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Cor
Hi

Download with VB.net

http://msdn.microsoft.com/library/de...dfiletopic.asp
Why not download the image file without loading it into the webbrowser
control?


Cor
Nov 20 '05 #5


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 ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #6
Cor
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
Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by ASP .NET Newbie | last post: by
reply views Thread by Jim Hubbard | last post: by
12 posts views Thread by Alex Clark | last post: by
8 posts views Thread by Prosperz | last post: by
11 posts views Thread by Anil Gupte | last post: by
4 posts views Thread by Steve Richter | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.