I'd like to know how can I change the rows' background color of a table, but my document have many tables, how can I specify the one that I want to be modified.
And how can I dynamically open an image? I want to store the image in a directory and on opening the document it shows that image from the directory.
I'd like to know how can I change the rows' background color of a table, but my document have many tables, how can I specify the one that I want to be modified.
You can locate the table when using its name (MoveToTable) or by searching for text inside of it.
And how can I dynamically open an image? I want to store the image in a directory and on opening the document it shows that image from the directory.
You need to insertert a linked image. If the property StreamName of the image is not empty the editor loads the contents from the provided filename (if it is one). It is also possible to loadf it through an event - OnHTTPLoadImage event.
I achieved to change the table's background color, but only for the first line, How can I modify the table's background color of each other line?
Like one line gray, the second white, the third gray, the fourth white...
I tried with the code below:
var
par: TParagraph;
begin
par := WPRichText1.FindParWithText('XXX');
if (par <> nil) and (par.ParentTable <> nil) then
begin
par := par.ParentPar;
par.ASetColor(WPAT_FGColor, clBlue);
par.ASetColor(WPAT_BGColor, clWhite);
WPRichText1.Refresh();
end;
end;