CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2000
    Posts
    264

    Printing HTML File from VB program

    Ok, I have generated an HTML file. Now, I need to print the file (not the contents, but the actual HTML file as it appears in the browser, but I do not want to open the browser). Does anyone know how to do this?

    I want the file to automatically print with no user intervention.

    I do not want the HTML file (browser) to open either.

    Thanks for any suggestions,
    Greg


  2. #2
    Join Date
    Oct 2000
    Location
    JHB South Africa
    Posts
    27

    Re: Printing HTML File from VB program

    I would use Internet control and just not display it.
    Set the URL and let it load the page. The internet control has a print method built into it.


  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Printing HTML File from VB program

    Try to download HTML to the file

    Private Declare Function URLDownloadToFile Lib "urlmon" _
    Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
    ByVal szURL As String, ByVal szFileName As String, _
    ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long


    Private Sub Command1_Click()
    Dim lRet As Long
    lRet = URLDownloadToFile(0, "http://www.experts-exchange.com", "c:\windows\desktop\test.htm", 0, 0)
    If lngRetVal = 0' Then DownloadFile = True
    MsgBox "Done downloading"
    else
    MsgBox "Error"
    End if
    End Sub


    and then print this file

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Jan 2000
    Posts
    264

    Re: Printing HTML File from VB program

    Where would I find this control? What reference? I loaded selected the Microsoft Internet Controls reference but i could not find any help on it. Is this the right one?




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