How do I print an html file ?

  • Thread starter Thread starter C.K
  • Start date Start date
C

C.K

Hello all,

I am still working on my calendar program, and I have decided that
the best way is for my vb program to write html tags into a file and
then to print the file from ie6. Everything is fine, the only thing that
I would like to do is to have my program print the html file
automatically. I saw the printdocument object, but I wanted to know,
firstly if it's possible, and secondly if I should use this object and how?

Tia
C.K.
 
* "C.K said:
I am still working on my calendar program, and I have decided that
the best way is for my vb program to write html tags into a file and
then to print the file from ie6. Everything is fine, the only thing that
I would like to do is to have my program print the html file
automatically.

\\\
Dim p As New System.Diagnostics.ProcessStartInfo()
p.Verb = "print"
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = "C:\filename.htm"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
///

- or -

<URL:http://groups.google.de/groups?selm=#[email protected]>
 
Hello again
:)

Your code does work, but I need something a little extra :
Before I can print the document I have to select the
'Page Setup' command from the File menu in IE6 and
choose A4 and setup the margins. Is there a way to
automise this either from dotnet, or even if perhaps there
are html tags which can control the browser (meta tags?)

Tia
C.K.
 
Your code does work, but I need something a little extra :
Before I can print the document I have to select the
'Page Setup' command from the File menu in IE6 and
choose A4 and setup the margins. Is there a way to
automise this either from dotnet, or even if perhaps there
are html tags which can control the browser (meta tags?)

Check out print templates. Also, you might like to look at the code here:

http://www.itwriting.com/htmleditor/index.php

There's code that makes it very easy to get print and print preview using a
print template. It doesn't make it easy to author the print template
though - you'd need to consult MSDN for that.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top