CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2001
    Posts
    1

    Printing via IE/ExecWB

    Hello,

    I am using vb to print an html document. In order to get the right output(not the text file with the tags in it) I have to use an html-capable device. I was trying to do this via the IExplorer, with the ExecWB command, but this only works when I debug the specific line. (which is strange enough? it sometimes works when debugging, but when running the code without any breakpoint a message box always shows up saying that it couldnt print.)

    Does anyone have any idea? I do not necessarily have to use the IE I just need to print html without having a dialog showing up(meaning as a background task)

    thanks in advance


  2. #2
    Join Date
    Jun 2001
    Location
    Ireland
    Posts
    56

    Re: Printing via IE/ExecWB

    You should you open the HTML page in word using word object model and use word to print.

    Andrew Lennon (Berlitz)
    Automation Dev Engineer

  3. #3
    Join Date
    Aug 2001
    Posts
    9

    Re: Printing via IE/ExecWB

    Hi, you can use the follow codes:
    Private Sub printHTML(strHTMLFile As String)
    Call Shell("rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML " & Chr(34) & strHTMLFile & Chr(34), vbHide)

    End Sub

    Tsinghua 2001/8/31 nanjing,P.R.C.


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

Featured