Delphi 5, Windows XP, WPTools v5.39 (yes, I know...May be this weekend)
Assume a document with 8 paragraphs. User clicks in middle of third para and drags mouse to middle of 5th para. So, some text is selected in 3rd para, all in 4th para and some in 5th para.
Question 1. How do I identify in code which paragraphs contain selected text? Using above example, code should identify para number 3, 4 and 5 as ones with selected text.
Question 2. How do I change font properties of the ENTIRE para, not just the selected text? Using Example above, I want to toggle Strike-out font for ENTIRE text of Para 3, 4 and 5.
The pseudo-code below shows what I need!
Code
procedure TForm1.Button1Click(Sender: TObject);
var par : TParagraph;
begin
par := WPRichText1.FirstPar;
while par<>nil do
begin
if This_Para_Has_Selected_Text then begin
Change_Font_of_Entire_Para(SomeFontProp);
end ;
par := par.next;
end;
end;
Alles anzeigen
As always, your help is greatly appreciated.
JayM