Click here to Skip to main content
15,928,207 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralQuestion on VS.NET and VS6.0 Compatibility Pin
theorion1626-Aug-02 12:01
susstheorion1626-Aug-02 12:01 
GeneralRe: Question on VS.NET and VS6.0 Compatibility Pin
Sijin27-Aug-02 1:42
Sijin27-Aug-02 1:42 
GeneralRe: Question on VS.NET and VS6.0 Compatibility Pin
Joe Woodbury2-Sep-02 7:19
professionalJoe Woodbury2-Sep-02 7:19 
QuestionProcess related question? Pin
imran_rafique25-Aug-02 1:54
imran_rafique25-Aug-02 1:54 
GeneralMaking IE do my printing work in .NET Pin
Domenic Denicola24-Aug-02 17:42
Domenic Denicola24-Aug-02 17:42 
GeneralRe: Making IE do my printing work in .NET Pin
Michael Mac25-Aug-02 6:49
Michael Mac25-Aug-02 6:49 
GeneralRe: Making IE do my printing work in .NET Pin
Domenic Denicola25-Aug-02 8:53
Domenic Denicola25-Aug-02 8:53 
GeneralRe: Making IE do my printing work in .NET Pin
Michael Mac25-Aug-02 9:27
Michael Mac25-Aug-02 9:27 
No problem. Smile | :)

First of all, you need to add WebBrowser support to your project. Right click on the toolbox and select Customize toolbox... On the tab page click Browse... and open shdocvw.dll which is located in the windows\system32 folder.
Now you can draw the control on your form.
The next thing which you must do it to load the document which you want to print.
Object missing = System.Reflection.Missing.Value;
axWebBrowser1.Navigate( "http://www.codeproject.com", ref missing,
 ref missing, ref missing, ref missing);


Print
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PRINT, 
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );


PageSetup
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PAGESETUP, 
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );


PrintPreview
axWebBrowser1.ExecWB( SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW, 
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing );


But be careful. The functions will fail if the document is not fully loaded. You can determine this thorugh NavigateComplete event.

And that's all. If you've got any question simply post it. Big Grin | :-D



43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
GeneralRe: Making IE do my printing work in .NET Pin
Domenic Denicola25-Aug-02 11:57
Domenic Denicola25-Aug-02 11:57 
GeneralRe: Making IE do my printing work in .NET Pin
Michael Mac26-Aug-02 4:50
Michael Mac26-Aug-02 4:50 
GeneralRe: Making IE do my printing work in .NET Pin
Domenic Denicola26-Aug-02 13:37
Domenic Denicola26-Aug-02 13:37 
GeneralRe: Making IE do my printing work in .NET Pin
Michael Mac27-Aug-02 0:58
Michael Mac27-Aug-02 0:58 
GeneralRe: Making IE do my printing work in .NET Pin
Domenic Denicola31-Aug-02 14:08
Domenic Denicola31-Aug-02 14:08 
GeneralThreads... Pin
Boris Yankov24-Aug-02 16:40
Boris Yankov24-Aug-02 16:40 
GeneralRe: Threads... Pin
James T. Johnson24-Aug-02 17:58
James T. Johnson24-Aug-02 17:58 
GeneralRe: Threads... Pin
Philip Fitzsimons27-Aug-02 5:11
Philip Fitzsimons27-Aug-02 5:11 
GeneralVideo Conferencing using NetMeeting API Pin
Ashutosh Pandey23-Aug-02 21:52
Ashutosh Pandey23-Aug-02 21:52 
GeneralRe: Video Conferencing using NetMeeting API Pin
Michael Mac28-Aug-02 2:29
Michael Mac28-Aug-02 2:29 
GeneralOne ore more types in the assembly unable to load Pin
User 2237022-Aug-02 17:42
User 2237022-Aug-02 17:42 
GeneralRe: One ore more types in the assembly unable to load Pin
James T. Johnson22-Aug-02 18:29
James T. Johnson22-Aug-02 18:29 
GeneralRecompile VC6 in .NET Pin
gharrison22-Aug-02 5:05
gharrison22-Aug-02 5:05 
GeneralRe: Recompile VC6 in .NET Pin
adamUK22-Aug-02 13:17
adamUK22-Aug-02 13:17 
Generalhelp me Pin
imran_rafique22-Aug-02 0:19
imran_rafique22-Aug-02 0:19 
GeneralMFC42.DLL in .NET Apps Pin
RichardEastes21-Aug-02 17:30
RichardEastes21-Aug-02 17:30 
GeneralRe: MFC42.DLL in .NET Apps Pin
Joel Lucsy22-Aug-02 14:58
Joel Lucsy22-Aug-02 14:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.