Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pasting RTF into Word
Message
From
27/11/2000 16:22:45
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
 
 
To
27/11/2000 12:54:43
Bob Lucas
The WordWare Agency
Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00445736
Message ID:
00445856
Views:
13
If printing is all you want here is some code I found on the UT a while back


*The following code is from Christof Lange :
*!* FUNCTION RichTextPrint
*==================================================
* Print the text of a RichText control
*==================================================
LPARAMETER tortf, tcprinter, tcdoc

IF !(TYPE('tortf') = "O")
lcmsg = "No RTF Object Passed Process Aborted"
MESSAGEBOX(lcmsg,mb_iconstop,"IMS-System Message")
RETURN
ENDIF
*-----------------------------------------------
* Declare some DLLs
*-----------------------------------------------
DECLARE INTEGER StartDoc IN Win32Api ;
INTEGER, STRING
DECLARE INTEGER StartPage IN Win32Api INTEGER
DECLARE INTEGER EndPage IN Win32Api INTEGER
DECLARE INTEGER EndDoc IN Win32Api INTEGER
DECLARE INTEGER CreateDC IN Win32Api ;
STRING, STRING, INTEGER, INTEGER
DECLARE INTEGER DeleteDC IN Win32Api INTEGER
DECLARE INTEGER HeapCreate IN Win32Api ;
INTEGER, INTEGER, INTEGER
DECLARE INTEGER HeapDestroy IN Win32Api INTEGER
DECLARE INTEGER HeapAlloc IN Win32Api ;
INTEGER, INTEGER, INTEGER
DECLARE INTEGER HeapFree IN Win32APi ;
INTEGER, INTEGER, INTEGER
DECLARE lstrcpy IN Win32Api INTEGER, STRING

*-----------------------------------------------
* Choose a printer
*-----------------------------------------------
LOCAL lcprinter
IF pcount() < 2
lcprinter = GETPRINTER()
* 04-11-2000 SEB
DECLARE _fpreset IN msvcrt20.DLL && reset the math coprocessor, avoid
=_fpreset() && Exception 10H error
ELSE
lcprinter = tcprinter
ENDIF
IF pcount() < 3
tcdoc = tortf.selrtf
ENDIF

*-----------------------------------------------
* Print
*-----------------------------------------------
LOCAL lnheap, lndoc, lcstruct, lnhdc
IF NOT EMPTY( lcprinter )
lnhdc = createdc("WINSPOOL",lcprinter,0,0)
lnheap = heapcreate(0, 8192, 8192)
lndoc = heapalloc( lnheap, 0, LEN(tcdoc)+1 )
lstrcpy( lndoc, tcdoc )
lcstruct = toint(12)+toint(lndoc)+toint(0)
startdoc( lnhdc, lcstruct )
startpage( lnhdc )
tortf.selprint( lnhdc )
endpage( lnhdc )
enddoc( lnhdc )
deletedc( lnhdc )
heapfree(lnheap, 0, lndoc)
heapdestroy(lnheap)
ENDIF

*==================================================
* Convert into an integer
*==================================================
FUNCTION toint
PARAMETER tnvalue
PRIVATE cstring, nt
cstring =''
FOR nt = 1 TO 4
cstring = cstring +CHR(tnvalue%256)
tnvalue = INT(tnvalue /256)
ENDFOR
RETURN cstring
Previous
Reply
Map
View

Click here to load this message in the networking platform