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
Code
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;
Alles anzeigen