Home General

Setting Bold in ppRichText doesn't print

edited August 2001 in General
In a prior posting I shown how to get a particular word in a ppRichText
component to be bold. I set it up in the OnPrint method of the ppRichText.
In the print preview it shows the word bolded but not in the actual printed
document.

Below is the code I used. The words (State Names ) to locate are in a
TStringList:

With ppRichText1 do
begin

for I := 0 to slStateList.Count -1 do
begin
if SelLength <> 0 then
iStart := SelStart + SelLength
else
iStart := 0;

iEnd := Length( RichText ) - iStart;
lFoundAt := FindText( slStateList[I],iStart,iEnd,[]);

if lFoundAt <> -1 then
begin
SelStart := lFoundAt;
SelLength:= Length(slStateList[I]);
SelAttributes.Style := [fsBold];
end; // lFoundAt

end; // slStatelist

Comments

This discussion has been closed.