Results 1 to 3 of 3

Thread: How to print a .html file

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290

    How to print a .html file

    I've tried using :

    result = ShellExecute(Me.hwnd, "PRINT", "REP.HTM", "", "", -1)

    but that involves the user having to click `ok` , which I don't want.

    I've also tried the WebBrowser control, but that doesn't let you print if you have a more recent version of the browser than v4 or so. (Needs to work on v5 onwards browser).

    There must be a simple way of printing .html files?!

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    Are you just wanting to put a button or link on your webpage that will allow the user to print it? If so, use this:

    Code:
    <script language="JavaScript">
    function PrintPage(){
    	window.print()
    }
    </script>
    
    <a href="javascript: PrintPage()">Click to print this page</a>
    This will display the print window to the user.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290
    thanks but no, i want to add a control/some code to a vb program.
    Ideally i`d like to be able to alter (for just the document being printed) properties such as landscape/portrait etc.

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