Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing print driver in VFP 9.0 1

Status
Not open for further replies.

lifesupport

Programmer
May 18, 2004
64
US
I had VFP code that changed the printer driver to Acrobat print driver then returned the driver back to the default print driver. In VFP 7.0, this worked fine. Just recently I upgraded to VFP 9.0 and this no longer works. It changes to the Acrobat Print driver just fine, but it won't return it to the original print driver. Originally I wrote:

Set print driver to name (pcoldprinter)
I step thru the code and the value of 'pcoldprinter' was correct.

Then I tried:
set print driver to set("printer",2) and also
set print driver to set("printer",3) and also
set print driver to default

None of these worked.

I cleaned out the values in the reports 'expr', tag & tag2 fields. Still didn't work.

Any idea why this won't change back?

Thanks
 
These are the helpfile notes on set printer...


SET PRINTER ON [PROMPT] | OFF
SET PRINTER FONT cFontName [, nFontSize [, nFontCharSet]] [STYLE cFontStyle]
SET PRINTER TO [FileName [ADDITIVE] | PortName]
SET PRINTER TO [DEFAULT | NAME WindowsPrinterName]
SET PRINTER TO NAME \\ServerName\PrinterName

If your previous printer is the default printer then use
set printer to default

Rob.
 

Hi Lifesupport,

First, setting the printer to SET("PRINTER",3) is never going to do any good. It justs sets the printer to whatever it was before you issue the command.

I suggest you do this:

Code:
lcPrevPrinter = SET("PRINTER",3)
SET PRINTER TO NAME Acrobat && or whatever you call the Adobe driver
&& do other stuff here
SET PRINTER TO NAME (lcPrevPrinter)

If that doesn't work, temporarily change the second line to point to a different printer (not an Acrobat driver). That will at least tell you whether it's your code or the Acrobat driver that's causing the problem.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
You need to be a bit careful changing the printer driver from within a running application sometimes too.

To an Acrobat one and back, has never caused me an issue - but some of the 'esoteric' ones don't load well, except at application startup. I'm thinking of HP ones and I don't know if it affects VFP 9 as much as it did VFP 5/6

Regards

Griff
Keep [Smile]ing
 
Thanks for the input. You guys were right. It seems that Acrobat 6.0 doesn't give my application in VFP 9.0 any problems, but once I try Acrobat 5.0, it won't work properly. So, it was the Acrobat driver. All I did was switch Acrobat 5.0 to 6.0 and back again; now the Acrobat 5.0 won't even load. It's acting inconsistently. Perhaps there's no work-around for this.
 
It turns out that Acrobat Adobe 5.0 only works with VFP 9.0 if you download the most current free Acrobat Adobe 7.0 reader.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top