Groups | Blog | Home
all groups > dotnet myservices > august 2004 >

dotnet myservices : Cannot get name of default printer from service


Sheri Sourbeck
8/24/2004 10:55:40 AM
I am using the following code to retrieve the name of the default printer:

Imports system.drawing.printing
Dim PD As New PrintDocument

PrinterName = PD.PrinterSettings.PrinterName

The code works fine when in a Windows form, but when run within a service
the PrinterName value is always <no default printer>. Is there a better way
to retrieve the name of the default printer from a service? Thanks in
advance!



Lee Gillie
8/25/2004 12:45:38 PM
[quoted text, click to view]

There really is no "THE" default printer. It is assigned on a per-user
basis.

Who's default printer do you want to retrieve ?

What username does your service logon as ?

Is it a domain user, or a local account ?

Has anyone ever logged onto that account, and set a default printer ?

Maybe you need a configuration for your service which allows the printer
AddThis Social Bookmark Button