Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print html page

105 views
Skip to first unread message

Von Shean

unread,
Jun 25, 2003, 2:08:30 PM6/25/03
to
How do i print html page in c# without using any browser components.


Nicholas Paldino [.NET/C# MVP]

unread,
Jun 25, 2003, 3:06:40 PM6/25/03
to
Von,

You will still need Internet Explorer on your machine, but you can do it
without loading the browser components. You will have to use the Process
class, running the following line:

rundll32.exe <windows directory>\system32\mshtml.dll,PrintHTML <filename>

There is an error with this though when office 2000 is installed on the
same system with internet explorer 5. Check out knowledge base article
274527, titled "Cannot Print File with .htm Extension from Windows Explorer
by Right-Clicking", located at (watch for line wrap):

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q274527

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com

"Von Shean" <vons...@hotmail.com> wrote in message
news:%23wSTFX0...@tk2msftngp13.phx.gbl...

Von Shean

unread,
Jun 25, 2003, 3:26:01 PM6/25/03
to
I wanted to ask one thing.
Is there something that will make it skip the print dialog that pops up?

"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:OQ8Ex10O...@TK2MSFTNGP11.phx.gbl...

Von Shean

unread,
Jun 25, 2003, 3:24:22 PM6/25/03
to
Thank you very much. it works for me.
Regards,

"Nicholas Paldino [.NET/C# MVP]" <nicholas...@exisconsulting.com> wrote
in message news:OQ8Ex10O...@TK2MSFTNGP11.phx.gbl...

Nicholas Paldino [.NET/C# MVP]

unread,
Jun 25, 2003, 4:04:17 PM6/25/03
to
Von,

I don't believe so. If you want to get around it, then you probably
have to load the document into a WebBrowser control and then issue a command
through ExecWB.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- nicholas...@exisconsulting.com

"Von Shean" <vons...@hotmail.com> wrote in message

news:uEDjaC1O...@TK2MSFTNGP11.phx.gbl...

0 new messages