Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to set the Default Printer
Message
 
 
To
09/08/2010 18:16:39
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00870520
Message ID:
01475844
Views:
93
Hi Debra,

Check the comment to the blog post. I'm thinking the Adobe Acrobat starts when you print it the first time and it doesn't exit when you try to print the second, that's why it's only printed to the first printer. I believe I recently saw a relevant thread (in Russian) on www.foxclub.ru website.

You probably need to kill Adobe after you printed the first time to make it work.

>Hi Sergey,
>
>I'm having a problem setting the default system windows printer.
>
>
>lcprintername = lcdefaultprinter 
>IF SetDefaultPrinter(lcprintername) = 0
>	SELECT(lnalias)
>	messagebox("Cannot change the default windows printer.", 0+16+0,"Error")
>	return .f.
>ENDIF
>
>ShellExecute(0,'Print',lcfile,"","",1)
>
>
>
>lcprintername = lcotherprinter 
>IF SetDefaultPrinter(lcotherprinter) = 0
>	SELECT(lnalias)
>	messagebox("Cannot change the default windows printer.", 0+16+0,"Error")
>	return .f.
>ENDIF
>
>ShellExecute(0,'Print',lcfile,"","",1)
>
>
>Both times the file gets printed to the first printer.
>Do you know what's going on with this?
>Even if I put a delay between them, it doesn't work.
>If I put lcotherprinter first, both times it prints to lcotherprinter.
>
>I can't seem to switch the system printer and print using the shell execute successfully. I'm printing a pdf file.
>
>
>Actually, I print to a bullzip pdf printer first and create the pdf.
>Then, I need to switch to a selected printer to print a hard copy of the pdf.
>
>Can you tell what's wrong here? Doesn't the shell execute do a print to the default windows printer?
>Is there something else I need to set? Or is this a timing issue?
>
>Any help would be greatly appreciated.
>
>Deb
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform