|
-
Feb 7th, 2003, 11:51 AM
#1
Thread Starter
Hyperactive Member
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?!
-
Feb 7th, 2003, 05:21 PM
#2
Fanatic Member
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
-
Feb 10th, 2003, 05:02 AM
#3
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|