Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / FoxPro / Reports and Printing / September 2008

Tip: Looking for answers? Try searching our database.

How to change the Windows Default Printer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
benjamin - 05 Sep 2008 19:59 GMT
How do you change the windows default printer from within VFP?

I can find out what it was using:
lcdefaultprt=set("printer",2)

How can I change from within VFP programmatically without going
through the print dialog?
apengelly@cix.compulink.co.uk - 05 Sep 2008 22:48 GMT
I think this maybe comes under the heading of "A Bad Thing To Do" in
principle. IMNSHO the user should be the one to decide and take the
appropriate action.

In article
<e27a89fe-6b25-40da-8107-2a85e106a98d@8g2000hse.googlegroups.com>,

> *From:* benjamin <dwight.wilcox@state.mn.us>
> *Date:* Fri, 5 Sep 2008 11:59:07 -0700 (PDT)
[quoted text clipped - 6 lines]
> How can I change from within VFP programmatically without going
> through the print dialog?

regards, Alan
Mike Gagnon - 06 Sep 2008 13:54 GMT
oNet = CreateObject('WScript.Network')
oNet.SetDefaultPrinter('\\ServerName\PrinterName')

> How do you change the windows default printer from within VFP?
>
[quoted text clipped - 3 lines]
> How can I change from within VFP programmatically without going
> through the print dialog?
benjamin - 08 Sep 2008 16:19 GMT
> oNet = CreateObject('WScript.Network')
> oNet.SetDefaultPrinter('\\ServerName\PrinterName')
[quoted text clipped - 6 lines]
> > How can I change from within VFP programmatically without going
> > through the print dialog?

I was trying to eliminate the Print dialog when the user knows that
they want a PDF (most of the time).
Instead of changing the system default driver I put in two sections of
code, one for VFP reports using:

Report form myform to printer NAME (lcprinter_to_use)

The other for Word documents:

m.wzprinter=loword.activeprinter
loword.Application.activeprinter = m.lcprinter_to_use
        loword.Application.PrintOut()
loword.Application.activeprinter = m.wzprinter

Thanks for the suggestions.
Craig Berntson - 15 Sep 2008 20:11 GMT
It's a very bad idea. Any application that changed my default printer would
very quickly be removed from my system. There are other ways to generate PDF
programmatically and without a dialog being displayed.

Signature

Craig Berntson
Microsoft MVP

-------------

On Sep 6, 7:54 am, "Mike Gagnon" <mikegag...@mcrgsoftware.com> wrote:
> oNet = CreateObject('WScript.Network')
> oNet.SetDefaultPrinter('\\ServerName\PrinterName')
[quoted text clipped - 10 lines]
> > How can I change from within VFP programmatically without going
> > through the print dialog?

I was trying to eliminate the Print dialog when the user knows that
they want a PDF (most of the time).
Instead of changing the system default driver I put in two sections of
code, one for VFP reports using:

Report form myform to printer NAME (lcprinter_to_use)

The other for Word documents:

m.wzprinter=loword.activeprinter
loword.Application.activeprinter = m.lcprinter_to_use
loword.Application.PrintOut()
loword.Application.activeprinter = m.wzprinter

Thanks for the suggestions.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.