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.