Solved

WebBrowser Control (Printing)

Posted on 2006-11-16
6
198 Views
Last Modified: 2010-04-16
Hello,

How to print the webbrowser control without showing the print dialog (select the printer and send it directly to print from my code)

C# .Net 2.0
VisualStudio 2005


Thanks,
0
Comment
Question by:amrelgarhy81
  • 3
  • 2
6 Comments
 
LVL 15

Expert Comment

by:ozymandias
Comment Utility
Do you mean print the document loaded into the webBrowser or actually print the webBrowser control itself - like a screen shot ?
0
 
LVL 1

Author Comment

by:amrelgarhy81
Comment Utility
No no
Print the contents of the webbrowser,
Like print the yahoo page that open in the webbrowser
NOT a screenshoot
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
Comment Utility
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 8

Accepted Solution

by:
kaliyugkaarjun earned 50 total points
Comment Utility
Also chk this..

There are three methods for doing this.

1. Sending ^p key, using SendKeys, which is not really clean programming :P

2. Using the shell command, and rundll32

Shell "rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML " & _ "http://www.developerfusion.com" , vbMinimizedFocus

3. Finally, method 3, which I think is the best method, and uses the built-in commands for the web-browser.

Private Sub PrintUserPage()
'navigate to the page you want
'you can delete this if you want to print the current page
WebBrowser1.Navigate ("http://www.developerfusion.com/")

DoEvents
'print
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
'you can change OLECMDEXECOPT_DONTPROMPTUSER to OLECMDEXECOPT_PROMPTUSER if you wish

End Sub
0
 
LVL 1

Author Comment

by:amrelgarhy81
Comment Utility
ExecWB dosenot exist in the Webbrowser Control in .Net 2.0
How to get it?
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now