Get ANSI text with line breaks

    • Offizieller Beitrag

    Q: How do I get text from WPRichText with the CRs intact?

    A: The ANSI writer creates \r\n at the end of every paragraph (not line!) :

    Code
    function TWPTextWriter.WriteParagraphEnd(par : TParagraph;       ParagraphType : TWPParagraphType; NeedNL :Boolean): Boolean;begin  if NeedNL then       Result := WriteString(#13+#10)  else Result := TRUE;end;

    If you need to get CR NL for every wrapped line use this code: