>yes - it's me again - sorry chaps!
>thanx to Ed, George, Fred and the lads, i have CopyFile() working fine getting draft printing to a DM printer, but trying to print .frx reports with W2k is a 'no go'. 'set printer to name &PrtName' gets a 'error accessing printer spooler' and 'report form xyz.frx to printer prompt noconsole' gets 'error loading printer driver' message. i have cleared out the junk in the report memo field etc. printing a windoze test page worx fine, but just nothing from vfp. under 98 and 95 everything worx fine.
>ideas anyone?
First, avoid using macro expansion as much as possible - unless the variable PrtName contains more than just the printer name, you can use name resolution by enclosing the variable in parenthesis, and the end result is not sensitive to delimiter characters in the printer name:
SET PRINTER TO NAME (PrtName)
This assumes that the printer is installed on your system already with a valid driver. Under NT, this can be either a Windows Printer Name as retrieved using GETPRINTER() or a selection from APRINTERS(), or the UNC of a remote printer that (1) has been previously installed on your system and has a driver associated with it already, or (2) the machine sharing the printer makes a set of drivers for Win2K/WinNT available to other Win2K/WinNT systems when they access the printer, so that the drivers self-install. THis behavior is commonly associated with 2K/NT systems that share a printer, where the administrator has taken the time to properly publish both Win9x and WinNT compliant drivers. Most Win9x boxes do not bother to publish NT-compliant drivers through the standard Printer Sharing dialogs, but a well-administered domain often handles this. NetWare shared printers usually do not publish drivers for the queues they manage, nor do most IP-based printing solutions.
I usually install a dummy printer named GTF to the device FILE:, with the Generic/Text Only driver on all my target systems; I can then do:
SET PRINTER TO NAME ("GTF")
SET PRINTER TO
MyFileNameand create generic output, even from report forms, or using text merge or ??? to send output to files for use with CopyFile() (with VFP6, I'm able to build strings and user STRTOFILE(), avoiding the issue entirely, using VFP's native string handling and VBScript.RegExp to parse and insert control codes as directed.)