* * Test printing RTF files * LParameters tcFile Local lo lo=CreateObject("conGPEditor") lo.Open(tcFile) =SetPrinterDevMode(goApp.oPrintParam) * * Print the document using the ActiveX control * but it ignores the printer settings!!!! * lo.Print(goApp.oPrintParam.Printer) * * Now I open a document and print it from VFP9 * and it prints as expected. If I check the * page setup dialog it contains the proper settings * Modify Command test4 Return Procedure SetPrinterDevMode Lparameters toParam Local lcRpt,ln1,ln2,ln3,ln4,ln5,ln6 lcRpt=Sys(2015) =PushWorkArea() Select 0 Create Cursor Temp (Test C(10)) Select 0 Create Report (gcTmp+lcRpt+".frx") From Temp Use In Select("Temp") Use (gcTmp+lcRpt+".frx") Exclu Alias UPDevMod Set Printer to (toParam.Printer) Sys(1037,2) ln1=At("ORIENTATION",UPDevMod.Expr) ln2=At("PAPERSIZE",UPDevMod.Expr) Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln1,ln2-ln1,"ORIENTATION=1"+Chr(13)+Chr(10)) ln2=At("PAPERSIZE",UPDevMod.Expr) ln3=At("ASCII",UPDevMod.Expr) Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln2,ln3-ln2,"PAPERSIZE="+Transform(GetPaperSize(toParam.PaperSize))+Chr(13)+Chr(10)) ln4=At("COPIES",UPDevMod.Expr) ln5=At("DEFAULTSOURCE",UPDevMod.Expr) Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln4,ln5-ln4,"COPIES=2"+Chr(13)+Chr(10)) If toParam.Tray<>"-1" ln5=At("DEFAULTSOURCE",UPDevMod.Expr) ln6=At("PRINTQUALITY",UPDevMod.Expr) Replace Next 1 UPDevMod.Expr With Stuff(UPDevMod.Expr,ln5,ln6-ln5,"DEFAULTSOURCE="+toParam.Tray+Chr(13)+Chr(10)) EndIf Sys(1037,3) Use In Select("UPDevMod") =PopWorkArea() EndProc>Can you post RTF printig code?