Results 1 to 3 of 3

Thread: printing by using webbrowser control...

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    Hyderabad
    Posts
    47

    printing by using webbrowser control...

    hai,
    i am using web browser control in my application. i am dynamically generating html file and i am opening that file by using webbrowser control. Now I want to take print out that file by using web browser control. I done this in Windows Operating System by using API. the following is that API.

    Shell "rundll32.exe c:\windows\system\MSHTML.dll,PrintHTML " & _
    wb.LocationURL, vbNormalFocus

    But it is not working in Windows-NT, even if i changed that directory to

    c:\winnt\system32\MSHTML.dll....


    can any body help on this...

    bye
    Pavan kumar

  2. #2
    New Member
    Join Date
    Oct 2001
    Location
    India
    Posts
    2

    Wink Reply For Printing Using the WebBrowser Control

    Hi Pavan,

    Nice meeting you.

    Try the code given below. Just copy as it is.

    Beaware you need a command button on the form containing Web Browser Control. Name it as cmdPrint.

    Good Luck.

    Private Sub cmdPrint_Click()
    Dim eQuery As OLECMDF
    On Error Resume Next
    eQuery = WebBrowser1.QueryStatusWB(OLECMDID_PRINT)
    If Err.Number = 0 Then
    If eQuery And OLECMDF_ENABLED Then
    WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, "", ""
    Else
    Exit Sub
    End If
    End If
    If Err.Number <> 0 Then Exit Sub
    End Sub


    Regards

    sushil

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2001
    Location
    Hyderabad
    Posts
    47

    Re: Reply For Printing Using the WebBrowser Control

    Hai thank u very much.... For that i found an alternative solution.... But any how thank you for that...
    Pavan kumar

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