473,799 Members | 3,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to access Explorer...Prin t function from code?

I have a button on my form to "Print". I would like to create an
HTML file, of the output, and call the Explorer...Prin t function when
this "Print" button is clicked. How can I do this - the
Explorer...Prin t part? I can create the HTML file, just need help with
calling the Explorer...Prin t function - supplying the path to the file
so that only the Print Dialog pops up once they click on "Print"

Thanks!
Jul 14 '08 #1
3 2621
Printing in windows forms is not normally performed like that. Printing is
normally done with a PrintDocument class which has an event which you handle
to do the printing which is done by GDI type drawing.
The easiest/cheapest/dirtiest way of doing what you want would be with a
Browser control. You could load the HTML into the browser control and call
the print function on that. That would then work just like internet explorer.

--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Andrew Meador" wrote:
I have a button on my form to "Print". I would like to create an
HTML file, of the output, and call the Explorer...Prin t function when
this "Print" button is clicked. How can I do this - the
Explorer...Prin t part? I can create the HTML file, just need help with
calling the Explorer...Prin t function - supplying the path to the file
so that only the Print Dialog pops up once they click on "Print"

Thanks!
Jul 14 '08 #2
Hello,

look at this: http://www.codeproject.com/KB/printing/printhml.aspx

Hope it helps.

Leo

"Andrew Meador" <an****@meadorc rafts.comwrote in message
news:04******** *************** ***********@t54 g2000hsg.google groups.com...
I have a button on my form to "Print". I would like to create an
HTML file, of the output, and call the Explorer...Prin t function when
this "Print" button is clicked. How can I do this - the
Explorer...Prin t part? I can create the HTML file, just need help with
calling the Explorer...Prin t function - supplying the path to the file
so that only the Print Dialog pops up once they click on "Print"

Thanks!
Jul 14 '08 #3
On Jul 14, 11:58*am, "Leo Seccia" <lsec...@msn.co mwrote:
Hello,

look at this:http://www.codeproject.com/KB/printing/printhml.aspx

Hope it helps.

Leo

"Andrew Meador" <and...@meadorc rafts.comwrote in message

news:04******** *************** ***********@t54 g2000hsg.google groups.com...
* I have a button on my form to "Print". I would like to create an
HTML file, of the output, and call the Explorer...Prin t function when
this "Print" button is clicked. How can I do this - the
Explorer...Prin t part? I can create the HTML file, just need help with
calling the Explorer...Prin t function - supplying the path to the file
so that only the Print Dialog pops up once they click on "Print"
Thanks!- Hide quoted text -

- Show quoted text -
Thanks Leo - this was what I was looking for. Got it done and it
works perfectly. I HATE windows printing. I have been looking at
ASP.NET programming a bit lately and didn't see why I shouldn't just
have my app create an HTML file/report and use this method to print
the html file. I seems to me that this is a lot easier than dealing
with the whole GDI/drawing approach. I get tables, borders, fonts,
etc... without having to deal with the font size calculations, line
spacing/tracking, etc...

If there is any other way that you guys recommend, I'm all ears,
but until then - I like this method! :)

Andrew
Jul 15 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6664
by: Michael | last post by:
Hallo I have the following problem: Within a web application I have to access the Java methods from JavaScripts. I'm using Sun's Java virtual machine version 1.3.1. Webbrowser is Microsoft Internet Explorer 5.0 Now the JSP: <html> <head>
6
4763
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
1
9203
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
8
3373
by: mytfein | last post by:
Hi Everyone, Background: Another department intends to ftp a .txt file from the mainframe, for me to process. The objective is to write a vb script that would be scheduled to run daily to process this .txt file. Goal: I am working on a vba script to:
7
8874
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6604
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
5
2693
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all that's come before. To take an extreme example, suppose you have been writing Visual Basic applications for years now. If you're like many developers, you will have built up a substantial inventory of code in that time. And if you've been following...
16
11859
by: John | last post by:
I am looking for VBA code that will work with Access 2003 to enable dragging and dropping a file/folder name from Windows XP Explorer into an Access form's text box. This is a common functionality that most Windows programs have, so I'm suprised it's not easier to implement in Access/VBA. Through Google, I found two VB6 examples and one VBA example on the Access Web written by Dev Ashish. The VB6 examples used loops to keep checking...
2
9481
by: crazyhouse | last post by:
Hi, I dont even know where to start on this one. I found this on the net (everything in italics are the authors comments): Public Function OpenFirstAttachmentAsTempFile(ByRef rstCurrent As DAO.Recordset, ByVal strFieldName As String) As String Dim rstChild As DAO.Recordset2 Dim fldAttach As DAO.Field2 Dim strFilePath As String Dim strTempDir As String
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10027
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.