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

.NET (Core and Framework)

 
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 
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 
Thanks so much for your help. If your interested, here's my solution:

private void DoPrintOperation(SHDocVw.OLECMDID operation)
{
   // Lots of irrelevant code for making tempFilename2 and filling it with .html data.

   // Set the print operation to be done upon navigation completion.
   this.printOperation = operation;
   
   // Navigate the printing web browser control to the document.
   // When the navigation is complete, this.printOperationEventHandler will do whatever this.printOperation says to do.
   object missing = Missing.Value;
   this.printingBrowser.Navigate(tempFilename2, ref missing,  ref missing, ref missing, ref missing);
}
   
private void printOperationEventHandler(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{
   object missing = Missing.Value;
   this.printingBrowser.ExecWB(this.printOperation, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref missing, ref missing);
}


Then in my event handlers, I have these code snippets:

this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PRINT);

this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW);

this.DoPrintOperation(SHDocVw.OLECMDID.OLECMDID_PAGESETUP);


Pretty elegant!

Big Grin | :-D Big Grin | :-D Big Grin | :-D

-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations

"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."

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.net on linux? and what languages supported Pin
timhuffam21-Aug-02 9:13
timhuffam21-Aug-02 9:13 
GeneralRe: .net on linux? and what languages supported Pin
Anonymous21-Aug-02 9:54
Anonymous21-Aug-02 9:54 
GeneralRe: .net on linux? and what languages supported Pin
timhuffam27-Aug-02 15:10
timhuffam27-Aug-02 15:10 
GeneralRe: .net on linux? and what languages supported Pin
Kevin McFarlane22-Aug-02 7:35
Kevin McFarlane22-Aug-02 7:35 
GeneralRetrieving web page content using C# Pin
Dave Stone21-Aug-02 3:48
Dave Stone21-Aug-02 3:48 

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.