Page 1 of 1 1
Topic Options
#187472 - 2008-05-06 01:44 AM AddPrinterConnection/SetDefaultPrinter
Tony Offline
Getting the hang of it

Registered: 2001-11-04
Posts: 55
Loc: LA
Guys,

I am not sure if this is what it supposed to do, but everytime I have my default printer set, the first line of addprinter connection is the one that determines the default printer.

For example:

AddPrinterConnection("\\lnx1\hp4000")
AddPrinterConnection("\\lnx1\Brother_8860")
SetDefaultPrinter("\\lnx1\Brother_8860")

The hp4000 would be the default. Seems like it is the first line.

Is this what it supposed to do?

TIA,
tt

Top
#187484 - 2008-05-06 09:37 AM Re: AddPrinterConnection/SetDefaultPrinter [Re: Tony]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
There is a slight difference between AddPrinterConnection and SetdefaultPrinter. The first takes the printer share (like \\server\printer) and the second takes the printer name (like HP4000 on server1). Also if AddPrinterConnection fails SetDefualprinter for the same printer will also fail if the printer is not still mapped from a previous session.
I always keep the printer name and share name the same so the example below works fine. Are the printer name and the printer share the same in your setup?

 Code:
If InGroup("Printer1")
	$rc = AddPrinterConnection ("\\server1\printer1")
	$rc = SetDefaultPrinter ("\\server1\printer1")
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#187490 - 2008-05-06 07:13 PM Re: AddPrinterConnection/SetDefaultPrinter [Re: Mart]
Tony Offline
Getting the hang of it

Registered: 2001-11-04
Posts: 55
Loc: LA
Mart,

Thanks for your reply. The share name and printer name is not the same in the test environment, but it is the same in the live.

I just renamed it and it works.

Thanks,
tt

Top
#187518 - 2008-05-08 01:44 AM Re: AddPrinterConnection/SetDefaultPrinter [Re: Tony]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
I just added this, as another workaround.

SetAsDefaultPrinter() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=187517#Post187517

This UDF allows you to use the Sharename (or Printername) to define the default.

Top
#187529 - 2008-05-08 07:03 PM Re: AddPrinterConnection/SetDefaultPrinter [Re: Allen]
Tony Offline
Getting the hang of it

Registered: 2001-11-04
Posts: 55
Loc: LA

I will give a try and report back.

Thanks.
Tt

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org