WPCubed Product Support

Text Formatted

Hi,

I try to apply formatting trying to certain tags but it does not work. I would replace @O with start bold and @o with finish bold.

Can you help me ?

Regards

wpRtf.Finder.ToStart;
      while wpRtf.Finder.Next('@O') do
      begin
      wpRtf.Finder.SelectText;
         wpRtf.SelectionAsString:='';
         wpRtf.Finder.FoundAttr.IncludeStyle(afsBold);
          p1:=wpRtf.Finder.Position;

    //     p1:=wpRtf.Finder.Position;
      //   wpRtf.Finder.SelectText;
      //   wpRtf.SelectionAsString:='';

         if WpRtf.Finder.Next('@o') then
         begin
          wpRtf.Finder.SelectText;
         wpRtf.SelectionAsString:='';
         wpRtf.Finder.FoundAttr.ExcludeStyle(afsBold);
          p2:=wpRtf.Finder.Position;
          wpRtf.SelStart:=p1;
          wpRtf.SelLength:=p2-p1;
         wpRtf.SelectedTextAttr.IncludeStyle(afsBold);
        //   wpRtf.SelLength:=p2-p1;
        //   wpRtf.SelectedTextAttr.IncludeStyle(afsBold);
        //            wpRtf.Finder.SelectText;
        // wpRtf.SelectionAsString:='';

         end;

      end;
      wpRtf.DelayedReformat;
#1 ♥ 0
3.3k Views 2 users read 1 min
support

I would use the Finder to search for

@O*@o and apply afsBold with SelectedTextAttr.AddStyle

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