How do i print whats in the WebBrowser control?

um pretty self explanitory by the subject...if the webbrowser control has navigated to a website...how can i make it print that website using code?

Comments

  • : um pretty self explanitory by the subject...if the webbrowser control has navigated to a website...how can i make it print that website using code?
    :
    Hi... I don't know if this works or not, but since I saw you asking about how to create a webbrowser, I started creating my own... and when I saw this question I wanted know how to do it too... so I looked for a tutorial an this is what I found. Hope it helps

    [code]
    Print the WebBrowser's contents
    Date: 4/15/2000
    Versions: VB5 VB6 Level: Intermediate
    Author: The VB2TheMax Team
    The WebBrowser control doesn't expose any method to directly print its
    contents. You can achieve this effect through the ExecWB method, by
    passing the OLECMDID_PRINT constant in its first argument:

    ' display the Print dialog
    WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER

    You can also immediately print the current document in the WebBrowser
    without displaying any dialog, as follows:

    WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER

    Note that the ExecWB method raises an error if the WebBrowser control
    doesn't contain any document, so in production code the above
    statements should be protected by an On Error command. The ExecWB
    support several other constants that let you access additional
    WebBrowser's features. For example, you can display the PageSetup
    dialog with the following code

    WebBrowser1.ExecWB OLECMDID_PAGESETUP, OLECMDEXECOPT_DODEFAULT
    [/code]


    =============
    ;-)Lizy

  • alright wow, that helps a lot, thanks!

    im havin a little trouble with it returning errors when it shouldnt,b ut that wont be hard to fix...thanks again!
  • : alright wow, that helps a lot, thanks!
    :
    : im havin a little trouble with it returning errors when it shouldnt,b ut that wont be hard to fix...thanks again!
    :
    That's what we are here for... to help eachother.


    =============
    ;-)Lizy

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories