WPCubed Product Support

Stripping out tables

Hello All,

Is there an easy way of stripping out tables from RTF snippets ?

I'm using TParagraph.LoadFromString to load RTF chunks, but some of the chunks have tables (pasted from Word) and I just want the text.

Regards, Paul

#1 ♥ 0
4.5k Views 3 users read 1 min
support

Hi,

the code should help.

var par : TParagraph;

   par :=  WPRichText1.FirstPar;
   while par<>nil do
   begin
      if par.ParagraphType = wpIsTable then
         par := par.DeleteParagraph
      else par := par.NextPar;
   end;
   WPRichText1.ReformatAll(false, true);

Julian

#3 ♥ 0
This category is archived. No new posts are possible.