Hello there,
I am quite new to .NET development so please forgive my question if it is
trivial. I am trying to print a IHTMLDocument2 object in c# without spawning
a dialog box, because the printing must be Automated.
I have got some code to work that does it with a dialog box, but this is not
what I need. Anyway, here is a snippet of the code I have already written: -
//Navigate to about:blank to initialise the IHTMLDocument2
-
object empty = System.Reflection.Missing.Value;
-
axWebBrowser1.Navigate(address_, ref empty, ref empty, ref empty, ref empty);
-
-
//stream the html code
-
mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
-
doc.clear();
-
doc.writeln( .... some html ....);
-
doc.close();
-
-
//print the html
-
doc.execCommand("print", true, 0 ); //this shows a dialog. i.e. not what I
-
need
-
Thanks in advance...
PS I am using Visual Studio .NET 2003 2 6081
Adam,
The 2nd parameter to execCommand is bUserInterface which you have set
to true. Have you tried setting it to false?
Jason Newell, MCAD
Software Engineer
Adam Hulbert wrote: Hello there, I am quite new to .NET development so please forgive my question if it is trivial. I am trying to print a IHTMLDocument2 object in c# without spawning a dialog box, because the printing must be Automated.
I have got some code to work that does it with a dialog box, but this is not what I need. Anyway, here is a snippet of the code I have already written:
- //Navigate to about:blank to initialise the IHTMLDocument2
- object empty = System.Reflection.Missing.Value;
- axWebBrowser1.Navigate(address_, ref empty, ref empty, ref empty, ref empty);
- //stream the html code
- mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
- doc.clear();
- doc.writeln( .... some html ....);
- doc.close();
- //print the html
- doc.execCommand("print", true, 0 ); //this shows a dialog. i.e. not what I
- need
-
Thanks in advance...
PS I am using Visual Studio .NET 2003
Adam,
After browsing around MSDN, I found this: http://msdn.microsoft.com/workshop/a...cprint_scr.asp
It would appear that setting bUserInterface to false will not have any
affect, but I would try it anyway. Sorry if I wasn't any help.
Jason Newell, MCAD
Software Engineer
Jason Newell wrote: Adam, The 2nd parameter to execCommand is bUserInterface which you have set to true. Have you tried setting it to false?
Jason Newell, MCAD Software Engineer
Adam Hulbert wrote:
Hello there, I am quite new to .NET development so please forgive my question if it is trivial. I am trying to print a IHTMLDocument2 object in c# without spawning a dialog box, because the printing must be Automated. I have got some code to work that does it with a dialog box, but this is not what I need. Anyway, here is a snippet of the code I have already written:
- //Navigate to about:blank to initialise the IHTMLDocument2
- object empty = System.Reflection.Missing.Value;
- axWebBrowser1.Navigate(address_, ref empty, ref empty, ref empty, ref
- empty);
- //stream the html code mshtml.IHTMLDocument2 doc =
- axWebBrowser1.Document as mshtml.IHTMLDocument2;
- doc.clear();
- doc.writeln( .... some html ....);
- doc.close();
- //print the html
- doc.execCommand("print", true, 0 ); //this shows a dialog. i.e. not
- what I need
-
Thanks in advance...
PS I am using Visual Studio .NET 2003 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jody Gelowitz |
last post by:
I am trying to find the definition of "Safe Printing" and cannot find out
exactly what this entitles. The reason is that I am trying to print
contents from a single textbox to no avail using the...
|
by: LilBuh |
last post by:
Hello :)
this is a repost... i ve been looking for a way since last week ...
i have a template html file that i modify from my code... i need to print
this file without IE's Header and Footer
or...
|
by: Adam Hulbert |
last post by:
Hello there,
I am quite new to .NET development so please forgive my question if it is
trivial. I am trying to print a IHTMLDocument2 object in c# without spawning
a dialog box, because the...
|
by: hamil |
last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview
control, the PageSetup control, and the Print dialog control. The code
attached is a concatination of two examples taken out...
|
by: hellohez |
last post by:
We are currently looking into triggering printing of an HTML file to a
designated printer in such a way that the print dialog box is not
viewed. It is possible to use the print method of a default...
|
by: John Peterson |
last post by:
Hello all!
I'm at my wits end trying to search for what I assumed to be a relatively
straightforward task. I have a Web application written in C#, and I have a
button on the form that I want to...
|
by: Siv |
last post by:
Hi,
I am getting into printing with VB.NET 2005 and want to implement the usual
capability that a user can select a selection of pages. I have a report
that is generated by my application that if...
|
by: GHS |
last post by:
I'm writing code to parse a specific website and decided to use MSHTML to
help (instead of regular expressions). The parsing code is complete - looks
very nice if I say so myself. :-)
The...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |