Results 1 to 3 of 3

Thread: another WebBrowser control question

  1. #1

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930

    Question

    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'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    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 .
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width