System.Windows.Forms.WebBrowser and AxSHDocVw Differences

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

HI

Trying to figure out the difference between these 2 browser

I am embedding a MS office Document (Word/Excel) in a WebBrowser on a Form

With AxSHDocVw I can do the following to save the current document
object o = new object();
axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVE,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER,
ref o, ref o);

oDocument = null;

But Windows.Forms.WebBrowser has no ExecWB method - I assume the Forms
webBrowser will be with DotNet v2.0 so I am assured it will

be on the pc - so I'd rather just it. How do I get a handle of the Document
within Windows.Forms.WebBrowser to save the file???

Thanks
 
Joe,

On a side note, you should pass Type.Missing.Value for the last two
arguments.

What you could do is call the ActiveXInstance property of the WebBrowser
control to get the ActiveX control.

You should also define the IWebBrowser2 interface somewhere in your code
(or, if you want, set a reference to the ocx which has the web browser
control).

Case the object returned by the ActiveXInstance property to the
IWebBrowser2.ExecWB method, and it will do what you want.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top