Antonio,
1) Using the save puts the text into the memofield with the formatting commands. However, when I retrieve that text the next time, it is NOT in RTF format. It shows all the formatting commands. I have reviewed this thread about a dozen times and tried every option provided for retrieving the text and making it ready for the RTF edit, but none of them work. All of the efforts were made several years ago, so I assume updates to the code may have changed.
Here is the code I have:
FUNCTION setup3
// Text Editor for disclosures
// Updated: 7/30/2015 5:55:48 PM
LOCAL oEndText, oDlg, nRcrd, oRich
PRIVATE cText := " ", cTitle := " ", cRtf := " "
// Open the text database
oEndText := tEndText():New( )
oEndText:gotop( )
// Load the text
cText := oEndText:tagtext
// Create the dialog
DEFINE DIALOG oDlg RESOURCE "SETUP3" BRUSH oBrush transparent OF oWnd
oDlg:nHelpID := 6
REDEFINE BUTTONBAR oBarS3 ID 100 SIZE 60,60 OF oDlg 2015
oBarS3:bClrGrad := aPubGrad
DEFINE BUTTON oWBtn3 OF oBarS3 RESOURCE "HRSAVE" ;
ACTION ( oEndText:tagtext := oRich:SaveasRTF( cText ), oEndText:save() )
DEFINE BUTTON oWBtn5 OF oBarS3 RESOURCE "HREXIT" ;
ACTION oDlg:end()
// Create edit control
REDEFINE RICHEDIT5 oRich VAR cText ID 2155 OF oDlg ;
MESSAGE "Edit the text, and press OK to save your changes" BARBUTTON
ACTIVATE DIALOG oDlg CENTERED
// Close the file
oEndText:close()
RETURN NIL
Suggestions ? I've tried the various Set and Load options described in this thread. There does not seem to be a final one.
2) rep22.prg does not demo anything with .RTF. Also, my question is doing a printout of RTF text with the PRINTER class, and NOT with a report. As stated above, for the complexity of my need, I cannot use a REPORT. I need the equivalent for RTF of this output:
oPrn:SayText( nRow, 10 * nCsp, MemoLine( oEndText:tagtext, 60, lx,, .T. ),,, oFnorm )
I would expect a SayRTF() Method but in the tPrinter class there is absolutely nothing that addresses RTF in any way. Perhaps there is another way ?