-
Does anyone know how to access the HTML code itself when using a WebBrowser control (besides right clicking inside the control itself)? I wanted to stick an option into the menu to view source. I'd like to be able to save and print the viewed page too, but I have no idea how to go about doing that outside of the control's popup menu.
-
I don't think there is a way to access that menu.
But here is how to get the web page's source, save the web page, and print the webpage:
Code:
Read
Text1.Text = Webbrowser1.Document.documentElement.innerHTML
Save
WebBrowser1.ExecWB OLECMDID_SAVEAS,OLECMDEXECOPT_PROMPTUSER
Print
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
-
Thanks. Just after I posted that I had the presence of mind to remember something you told me earlier, and I checked out the thing on the MSDN site, and it tells how to save and print. There was another link that I believe you had passed in regards to me asking about adding to a popup menu in the WebBrowser control, but it went way way over my head. I think it used XML or something, and I can read Chinese better than I can decipher XML :D.