|
-
Nov 26th, 2000, 06:49 PM
#1
Thread Starter
Addicted Member
Greetings,
Does anyone know how to Preview a HTML page with api and then eventualy print it ?
Thanks in advance!
-Lumin
-
Nov 26th, 2000, 08:35 PM
#2
Use the Webbrowser Control.
First create the page:
Code:
Open "C:\htmlpage.htm" For Output As #1
Print #1, Text1.text
Close #1
Then, in the Custom Controls list, choose Microsoft Internet Controls.
And then navigate to the file:
Webbrowser1.Navigate "C:\htmlpage.htm"
And then have a print button:
Code:
Private Sub CmdPrint_Click()
WebBrowser1.ExecWB OLECMDID_PRINT, _
OLECMDEXECOPT_PROMPTUSER
'If you don't want to prompt the user to print:
'WebBrowser1.ExecWB OLECMDID_PRINT, _
OLECMDEXECOPT_DONTPROMPTUSER
End Sub
-
Nov 27th, 2000, 07:14 PM
#3
Thread Starter
Addicted Member
Thanks, But im trying to avoid using the webbrowser control since its taking space and my program should take as little KB as possible. 
So I was wondering if windows has any Dll's I can call up instead. since windows usualy has Dll'd loaded for almoust evrything I would expect it to have a dll with these kind of functions. or am I expecting to much of windows now ? 
Anyway thanks for the help.
-Lumin
-
Nov 27th, 2000, 07:16 PM
#4
Thread Starter
Addicted Member
Oh dang it.. I didn't read your post entierly .. sorry gona try your sugjestion now
Thanks!!
-Lumin
-
Nov 27th, 2000, 07:28 PM
#5
You can avoid the Webbrowser Control.
What you can do...is reference it instead. So you don't have to use the control on your form, but rather, open IE and preview it from there.
Code:
'Form Declarations:
Dim ie As New Internet Explorer
Private Sub cmdPreview_Click()
ie.Navigate "C:\htmlpage.htm"
ie.Visible = True
End Sub
That is probably one of the closest ways that you can get to being able to preview and print it. And the user can just use the IE window's Printing.
Code:
Private Sub CmdPrint_Click()
ie.ExecWB OLECMDID_PRINT, _
OLECMDEXECOPT_PROMPTUSER
'If you don't want to prompt the user to print:
ie.ExecWB OLECMDID_PRINT, _
'OLECMDEXECOPT_DONTPROMPTUSER
End Sub
^I assume it'd work the same way as the Webbrowser Control.
It may still take up space, but I don't think your going to find any other way. There are controls out there that can print and have a print preview on them, you may want to look for them if you don't like my way.
But, I'm just giving you suggestions .
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
|