Re: Setting Default Printer

2004-12-29 Thread Paul Hastings
Jones, Becky wrote:
> Im trying to do this on the client.  I want to present them with a list
> of their printers and have them select which one they want as a default.

not with CFX_EnumPrinters you aren't, it's for server side.

~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188974
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Setting Default Printer

2004-12-29 Thread Dave Watts
> Im trying to do this on the client.

Oh, and I don't think you'll be able to do this in a cross-platform way. A
Windows Script solution will only work for people using Windows and Internet
Explorer.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188954
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Setting Default Printer

2004-12-29 Thread Dave Watts
> Im trying to do this on the client. I want to present them with a list
> of their printers and have them select which one they want as a default.

Well, to be perfectly honest, I think this is a bad thing to do from within
a web page. The user's computer has perfectly good mechanisms to do this
already. If you simply use JavaScript to open the standard printer dialog
from within your application, the user will be able to print your web page
just like she'd print from any other application.

If you still wish to continue, you could presumably do what you want by
placing that VBScript within your page to run on the client. You will not be
able to do this purely with server-side code.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188953
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Setting Default Printer

2004-12-29 Thread Jones, Becky
Im trying to do this on the client.  I want to present them with a list
of their printers and have them select which one they want as a default.


-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 29, 2004 1:21 PM
To: CF-Talk
Subject: RE: Setting Default Printer

> Does anyone know how to set a default printer from a list of prints 
> shown in a webpage?  im using the tag  to enumerate 
> the printers, but im not sure how to allow the user to pick the
default.

Are you trying to set a default printer on the server or on the client?
Presumably, your CFX custom tag lists printers on the server, not the
client. You could run the VBScript code you posted from a command shell
using CFEXECUTE, or adapt the code somewhat to make it available as a
WSH COM object, although I've had limited success in using Windows
Script from CFMX to control printers and would try to avoid doing that
if I could.

Instead, you could simply track the printer choice that the user made
and force server print jobs to use that printer within your own code.

Finally, keep in mind that the server will only be able to have one
default printer, so if one user changes it to printer A and another
changes it to printer B, someone's going to be disappointed.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444




~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188946
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: Setting Default Printer

2004-12-29 Thread Dave Watts
> Does anyone know how to set a default printer from a list of prints
> shown in a webpage?  im using the tag  to enumerate
> the printers, but im not sure how to allow the user to pick the default.

Are you trying to set a default printer on the server or on the client?
Presumably, your CFX custom tag lists printers on the server, not the
client. You could run the VBScript code you posted from a command shell
using CFEXECUTE, or adapt the code somewhat to make it available as a WSH
COM object, although I've had limited success in using Windows Script from
CFMX to control printers and would try to avoid doing that if I could.

Instead, you could simply track the printer choice that the user made and
force server print jobs to use that printer within your own code.

Finally, keep in mind that the server will only be able to have one default
printer, so if one user changes it to printer A and another changes it to
printer B, someone's going to be disappointed.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188945
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Setting Default Printer

2004-12-29 Thread Jones, Becky
Does anyone know how to set a default printer from a list of prints
shown in a webpage?  im using the tag  to enumerate
the printers, but im not sure how to allow the user to pick the default.
 
i found a script do this with vbscript, but i want to do it in a
webpage:
any help is appreciated!
thank you in advance. :)
Sub DefaultPrinter
 
  Dim Text, Title, i, j, tmp, printer
  Dim Network, oDevices
 
  ' Create a new Network object to access Network properties
  Set Network = CreateObject("WScript.Network")
 
  ' Read all printers
  Set oDevices = Network.EnumPrinterConnections
 
  Text = "Available printers" & vbCRLF
  For i = 0 To oDevices.Count-1 Step 2
  j = i
  Text = Text & (i / 2) & vbTab
  Text = Text & oDevices(i) & vbTab & oDevices(i+1) & vbCRLF
Next
 
' Show all available printers and allow a user selection
tmp = InputBox (Text,"Set default printer",0)
 
printer = oDevices(tmp * 2)   ' select printer name
 
' Set the default printer
Network.SetDefaultPrinter printer
 
MsgBox "Set Default printer to " & printer, _
vbOkonly + vbInformation, Title
 
Set Network = Nothing
 
End Sub
 
DefaultPrinter


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188924
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54