473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Changing default printer.....

I am using the PrintDocument for my print application.

Currently it is printing to the default printer.

How to change to a different printer?

VB.Net 2003 & .Net Framework 1.1.

Thank you,

Pete
Feb 9 '06 #1
4 4456
jvb
Try opening a PrintDialog box and setting it's return value equal to
the printer that the user selects.

Feb 9 '06 #2
Sorry I forgot to mention. It is an automated program. No manual
intervention.
-Pete
"jvb" <go*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Try opening a PrintDialog box and setting it's return value equal to
the printer that the user selects.

Feb 9 '06 #3
Hi Pete,

If there is no user intervention possible, You can use the
PrintDocument.PrinterSettings property, through which you can specify
several Printer settings.
---------------------------------------
Dim pd As New PrintDocument()

' Specify the name of the printer to use.
pd.PrinterSettings.PrinterName = MyPrinter

'Set the no. of copies to print
pd.PrinterSettings.Copies = 2

'Set the range of pages to print
pd.PrinterSettings.PrintRange = PrintRange.AllPages

If pd.PrinterSettings.IsValid then
pd.Print()
Else
MessageBox.Show("Printer is invalid.")
End If

---------------------------------------

If you don't know the names of the installed printers, you can get it from
the PrinterSettings.InstalledPrinters collection.

Regards,

Cerebrus.
Feb 10 '06 #4
See my article of March 2005 at http://emoreau.s2i.com/

--
HTH

Éric Moreau, MCSD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Concept S2i inc. (www.s2i.com)
http://emoreau.s2i.com/

"Pete Smith" <Pe*********@hotmail.com> wrote in message
news:OY**************@TK2MSFTNGP15.phx.gbl...
I am using the PrintDocument for my print application.

Currently it is printing to the default printer.

How to change to a different printer?

VB.Net 2003 & .Net Framework 1.1.

Thank you,

Pete

Feb 11 '06 #5

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

Similar topics

2
by: Jody Burgess | last post by:
Hi; I am writing my first python program and would like to know how to change stdout to refer to my default printer or any other printer on my network. The other question is, Is there an API set...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
6
by: Ioannis Demetriades | last post by:
Hi, I need to change the printer's font to "control" -a printer font, and then send a sequence of characters to the printer. My problem is that I cannot change the printer's font. Can this be...
0
by: Anthony Nystrom | last post by:
I am having trouble with changing printer settings before I raise either the pagesetup dialog or the print preview dialog... Changing the printer name is easy, but I am also trying to change the...
3
by: Rick R | last post by:
We need to change the paper size for the default printer before printing a PDF file from within a VB.Net application. printDocument printerSettings is not appropriate as there is no document to...
2
by: ExitusLSU | last post by:
Is there a way to change the DEFAULT printer settings for an installed printer? I want it to change the printer settings for a specified printer at the whole OS/Windows level, not just for the...
3
by: Panos | last post by:
Hi all, I am trying to print a report in A4 paper, but my printer's default paper is different (Letter 8.5 x 11 inches). So when i print, a significant part of the paper remains blank, because of...
0
by: Panos | last post by:
Hi all, I am still trying to print a report in A4 paper, but my printer's default paper is different (Letter 8.5 x 11 inches). So when i print, a significant part of the paper remains blank,...
9
spider1916
by: spider1916 | last post by:
I am using the common dialog control to allow my users to select any printer available to them. The code I am using keeps changing the selected printer to the default printer............I don't...
8
by: ncsthbell | last post by:
Is there a way to change my default printer using vb? I have some reports I want to print to a certain printer and some to a different one. I have a routine that loops through all of the reports to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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 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.