I need to obtain only plain text from a WPRichText1...
Thank's
André Aigneren
Genesys Ingeniería Ltda.
I need to obtain only plain text from a WPRichText1...
Thank's
André Aigneren
Genesys Ingeniería Ltda.
The following will do it, but may be a little inelegant for what you want:
wpRichText1.selectAll;
s:=wpRichText1.selText;
wpRichText1.selLength:=0; //or store the previous selStart and SelLen and restore them.
There may be a better way to do this, but I can't remeber finding one.
Regards,
Mark
Alternative:
a) s := WPRichText1.Text;
or
b) TextSaveFormat := 'ANSI'; s := WPRichText1.AsString;
Julian
Zitat von MARK WILLIAMSThe following will do it, but may be a little inelegant for what you want:
wpRichText1.selectAll;
s:=wpRichText1.selText;
wpRichText1.selLength:=0; //or store the previous selStart and SelLen and restore them.There may be a better way to do this, but I can't remeber finding one.
Regards,
Mark
Thank's for you Help !!
Thank´s for you Help !!
I have another problem....
I create this WPRichText1 at RUNTIME and I recived with WPRichText1.Text only #$D#$A#$D#$A#$D#$A#$D#$A ??
Thank one more time André
The GetText function requires the text to be visible. If this is the case it will eliminate hidden characters. Use the AsString property instead.
Do you only need a RTF to ANSI conversion ?
Then use the function
function WPToolsRTFToANSI(const input: string): string;
which is in unit WPrtfTXT. It does not require any TWPRichText.
Julian