Normal Topic AlternateDefaultPrinter(printer as string) (Read 1951 times)
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
AlternateDefaultPrinter(printer as string)
Oct 9th, 2004 at 3:23am
Print Post Print Post  
Hi,

Pls can someone advise how to use this function

AlternateDefaultPrinter(printer as string)

(the printer as string) parameter has thrown me - what syntax should i use.

Also with the RestoreDefaultPrinter() command do i need to put any statements inside the brackets?

My aim is to use different network printers based on entries in particular elements in my form & be in a position to use specialised label printers.

Any help much appreciated
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: AlternateDefaultPrinter(printer as string)
Reply #1 - Oct 9th, 2004 at 5:03am
Print Post Print Post  
Syntax for each is:
Quote:
AlternateDefaultPrinter("Printer Name As A String")
RestoreDefaultPrinter()
The AlternateDefaultPrinter function takes a string argurment for a value.
The RestoreDefaultPrinter takes no argument, just the ()

Sample of local printer as Alt Default, and sample of network printer as Alt Default: Quote:
AlternateDefaultPrinter("PDF995")
AlternateDefaultPrinter("\\Server\SharedPrinterName")


Sample of restoring normal Default Printer. Quote:
RestoreDefaultPrinter()


To see a list of the printers that are available to you on the network, go to a Command Promt (Dos window), and type Net Use.

Open any program that prints, click on the Print option from the menu and then click on the DropDown arrow next to the printer name to get a list of printers on your local machine.

You can also use the Printer Names as shown in your Printers window of Explorer.

You can also see the "Shared" name of your local printers by going to the tab for Sharing.  Look at the shared name.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: AlternateDefaultPrinter(printer as string)
Reply #2 - Oct 9th, 2004 at 6:19am
Print Post Print Post  
Hi Bob,

Thanks for the quick answer  Cheesy
  
Back to top
 
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: AlternateDefaultPrinter(printer as string)
Reply #3 - Oct 9th, 2004 at 6:52am
Print Post Print Post  
Hi Bob,

I'm having some problems with this command - i'm using sesame 1.0.4

i've set up 2 local printers on my PC
(same printer) the default is set as a portrait printer.

The "second" printer has been set up in landscape mode & i've called it "landscape"

I've set up a command button to print from the form with the following programing

if file# ="28" then AlternateDefaultPrinter("landscape")

Newpage(825,1150)

Printstring(type,20,35,0,"BARIAL",48,0)
Printstring("DEADLINE",600,35,0,"ARIAL",33,0)
Printstring(DEADLINE,600,70,0,"ARIAL",33,0)
Printstring("INITIATED BY:- ",20,80,0,"ARIAL",16,0)
Printstring(INITIATED BY,-1,-1,0,"ARIAL",16,0)
Printstring(le2,20,150,0,"ARIAL",30,0)
Printstring(customer,30,150,0,"ARIAL",30,0)
Printstring(location, -1, -1,0,"ARIAL",30,0)
Printstring(grade, -1, -1,0,"ARIAL",30,0)

finishpage()

the output still prints as portrait

what have i missed out ?

many thanks in advance

  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: AlternateDefaultPrinter(printer as string)
Reply #4 - Oct 9th, 2004 at 6:28pm
Print Post Print Post  
Hi beagle.....

The programming code looks good to me.  I copied your code and used it on my system, sending to a PDF printer vs. a default bubble jet printer.   Worked fine. 

What happens if you select that "landscape" printer from the Select Printer drop down list from another program? Does the copy come out in landscape mode?

At this point, I can only suggest that you double check the settings on the "landscape" printer, and make sure that the defaults for landscape orientation are truly there.  Does your system require you to reboot to retain the printer settings?

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: AlternateDefaultPrinter(printer as string)
Reply #5 - Oct 9th, 2004 at 9:05pm
Print Post Print Post  
Hi Bob,

I did as you suggested (after I posted my last reply).

I seem to be having some problems with my local printer  Undecided

So looks like I will have to try this technique at the office - where there is a network.

Thanks for taking the time to check this out for me - much appreciated

Beagle
  
Back to top
 
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: AlternateDefaultPrinter(printer as string)
Reply #6 - Oct 10th, 2004 at 10:40pm
Print Post Print Post  
Hi Bob,

I set this up on our network @ the office & it worked !!!

Another feather in sesame'sb cap
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: AlternateDefaultPrinter(printer as string)
Reply #7 - Oct 10th, 2004 at 11:59pm
Print Post Print Post  
Congrats......

Do we need to go Off Topic to work on your local printer?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
beagle
Junior Member
**
Offline


No personal text

Posts: 80
Location: australia
Joined: May 28th, 2004
Re: AlternateDefaultPrinter(printer as string)
Reply #8 - Oct 11th, 2004 at 3:38am
Print Post Print Post  
Hi Bob,
Thanks for the offer re the local printer - but for home use, it's not really an issue - ultimatly, the office is where Sesame (& this particular function) will be used.

  
Back to top
 
IP Logged