OK, Thank you !! I search the character #10 when the cursor is in a table and search the character #13 when the cursor is not in a table.
Beiträge von Turbito
-
-
Thank you, but I continue without I can't select the text until the first CR/LF "Chr(13)" in text of the row of the table (the cursor is in the table).
How can I do ??
-
This is my new code and very good with a new document but in the row of table don't found End Of Line.
procedure SelectUntilEOL;
var
start, endp : Integer;
findEOL: Boolean;
begin
findEOL := False;
start := WPRichText1.CPPosition;
repeat
if WPRichText1.CPChar^= #13 then
begin
endp := WPRichText1.CPPosition;
WPRichText1.SetSelPosLen(start, endp-start);
findEOL := True;
end;
until not(WPRichText1.CPMoveNext) or findEOL;
end; -
I want select text until the first End Of Line (until find #13).
This is my bad code:
procedure SelectUntilEOL;
var
start, endp : Integer;
begin
start := WPRichText1.CPPosition;
repeat
if Ord(WPRichText1.CPChar^)= 13 then
begin
endp := WPRichText1.CPPosition;
WPRichText1.SetSelPosLen(start, endp-start);
end;
until not(WPRichText1.CPMoveNext);
end; -
Hi, I want insert a graphic protected and imposible delete in the editor.
For insert a graphic...
procedure InsertImage(Source : TImage);
var obj: TWPOImage;
begin
obj := TWPOImage.Create(WPRichText1);
obj.Picture.Assign(Source.Picture);
obj := TWPOImage.Create(WPRichText1);
obj.Picture.Assign(Source.Picture);
obj.WidthTW :=
MulDiv(Source.Width, 1440, Screen.PixelsPerInch);
obj.HeightTW :=
MulDiv(Source.Height, 1440,Screen.PixelsPerInch);
WPRichText1.TextObjects.DefaultPositionMode := wpotPar;
// Alternative: wpotChar
WPRichText1.TextObjects.Insert(obj);
end;