Whoops! Did it again. This code would be more useful in Version 3 apps where set(printer,1) does
not return the Windows default printer.
FYI: The following code, along with Rick Strahl's registry class (in the files section) will get you the current Windows default printer name for comparison with the results of aprinter():
>#DEFINE HKEY_LOCAL_MACHINE -2147483646
>
>set proc to registry.prg
>oRegistry=CREATE("Registry")
>DIMENSION taVals[1,2]
>
>lnVals=oRegistry.GetEnumValues(@taVals,HKEY_LOCAL_MACHINE,;
> "Config\0001\System\CurrentControlSet\Control\Print\Printers")
>
>? 'Default printer is: ', taVals(1,2)
>
kenweber
GCom2 Solutions
Microsoft Certified Professional