473,386 Members | 1,860 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,386 software developers and data experts.

Getting the default printer

Hi, is there a way that i could get the default printer of the system? I'm
using VB.net 2001. There is a function in SDK called "GetDefaultPrinter", but
i don't understand how to use it.

Nov 30 '05 #1
3 17049
"Panos" <Pa***@discussions.microsoft.com> schrieb:
Hi, is there a way that i could get the default printer of the system? I'm
using VB.net 2001


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/654608b1fa80e219>

\\\
Imports System.Drawing.Printing
..
..
..

Private ReadOnly Property DefaultPrinterName() As String
Get
Dim ps As New PrinterSettings()
Return ps.PrinterName
End Get
End Property
..
..
..
Dim DefaultPrinter As String = DefaultPrinterName
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #2
If you set PrinterName property to another printer, will this then become the
default printer after the application closes or does it revert to the
original default printer?
--
Dennis in Houston
"Herfried K. Wagner [MVP]" wrote:
"Panos" <Pa***@discussions.microsoft.com> schrieb:
Hi, is there a way that i could get the default printer of the system? I'm
using VB.net 2001


See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/654608b1fa80e219>

\\\
Imports System.Drawing.Printing
..
..
..

Private ReadOnly Property DefaultPrinterName() As String
Get
Dim ps As New PrinterSettings()
Return ps.PrinterName
End Get
End Property
..
..
..
Dim DefaultPrinter As String = DefaultPrinterName
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 1 '05 #3
"Dennis" <De****@discussions.microsoft.com> schrieb:
If you set PrinterName property to another printer, will this then become
the
default printer after the application closes or does it revert to the
original default printer?


I don't think that it will change the system's default printer permanently.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 1 '05 #4

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

Similar topics

1
by: Pablo | last post by:
Friends, how can i get the name of the default printer??. I'm working with winforms. VB,C#, nevermind. Thanks a lot Pablo
2
by: Andy | last post by:
How do you set the default printer in C#? I have added a printer and now want to set that printer to the default. Listed below is my code, but I am getting an "Invalid method Parameter(s)" error...
3
by: Geraldine Hobley | last post by:
Hello, How would you get and set the current default printer by using the system.drawing.printing class or any other class. Regards Geri
1
by: Geraldine Hobley | last post by:
Hello, I have the following code that sets the default printer using the WMI (windows management system). ' Add a Reference to System.Management Dim moReturn As...
0
by: Karthick_Microsoft | last post by:
Actually, in my ASP.Net application, i have a requirement of automatically changing the default printer. I did a OCX using VB and put it on the web page. The client machines do not have local...
1
by: i8mypnuts | last post by:
Could someone please help? I am using the 'defaultprt.zip' tool provided by Ken Getz to change the default printer via VBA code (code below). My problem is that once the default printer has been...
5
by: Glenn | last post by:
Hi We have a ASP.net app which calls into a web service which allow users to print stuff. At the moment they have to specify the printer. Apparently this is too much for our users, so I was...
13
by: Mark Rae | last post by:
Hi, I have used the code below to return the default printer in 32-bit WinXP Pro, but now that I am running 64-bit Vista Business I'm getting an error: using System.Drawing.Printing; using...
0
by: Tim | last post by:
Our application has used this PrintersClass module for some time without a problem but some new Toughbooks have caused problems. We use laser printers, usually the default choice, and some label...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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:
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...
0
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,...
0
jinu1996
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 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.