>>>>I don't see simple solutions anymore. So there are two more complicated (just a bit).
>>>>The first one would be to reset Windows default printer (programmatically), and then use Set Printer To Default command. Would you like to try?
>>>
>>>I'll play around with some work-arounds a bit. I don't hold much hope, however.
>>>Thanks for your assistance.
>>>Allen
>>
>>It seems you misunderstood. Do you want to get code how to switch Windows printer programmatically so you will use it and then SET PRINTER TO DEFAULT in your code?
>
>Oh. yes thanks.
>Allen
Function resetwindowsprinter
Lparameters cPrintername
If printerexist(cPrintername)=.F.
Return .F.
Endif
Declare Integer SetDefaultPrinter In WINSPOOL.drv String
If SetDefaultPrinter(cPrintername)<=0
Clear Dlls
Return .F.
Endif
Clear Dlls
Return .T.
Endfunc
Function printerexist
Lparameters cPrintername
Local nLoop
Local Array aTemp(1)
If Empty(cPrintername)
Return .F.
Endif
If Aprinters(aTemp)<=0
Return .F.
Endif
For nLoop=1 To Alen(aTemp,1)
If Upper(Alltrim(aTemp[nLoop,1]))==Upper(Alltrim(cPrintername))
Return .T.
Endif
Endfor
Return .F.
Endfunc
Edward Pikman
Independent Consultant