Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page size
Message
From
06/12/2007 05:15:16
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01273148
Message ID:
01273525
Views:
23
This message has been marked as the solution to the initial question of the thread.
Use that function:
dosprn("myprint.txt","HP on secretary")


func dosprn
LPARAMETERS xfile,xport

LOCAL xstr
  xstr=FILETOSTR(m.xfile)

	   SET PROC TO DIRPRTCLASS.PRG ADDITIVE
	   oDirPrt = CREATEOBJ('DirectPrintOutput')
    WITH oDirPrt
	      .PrinterOpen(m.xport) 
	      IF .PrinterIsOpen()
	         .DocOpen('MySpool')
	         .DocWrite(m.xstr)
	         .SpoolFile('MySpoolFile.TMP', .T.) 
	         .DocClose()
	         .PrinterClose()  
	      ELSE
	        DECLARE INTEGER CopyFile IN kernel32;
            	STRING lpSrcFile, STRING lpDstFile, INTEGER bFail
                           CopyFile(m.xfile,m.xport, 0)

	      ENDIF
	   ENDWITH
Previous
Reply
Map
View

Click here to load this message in the networking platform