WPCubed Product Support

Inserting image into cell

Hi,
For years I've been using the code bellow to insert an image at the top of the document using WPRichText, but now I need to insert the image into a
cell in a table, actually, the first column on the first row.
How can i do that using as much as possible of the code bellow or if not, how?

var par: TParagraph;
FWPObj: TWPOImage; // Used to store the logotipo
begin
FWPObj := TWPOImage.Create(WPRichText1);
FWPObj.Graphic := Image1.Picture.Graphic;
FWPObj.WidthTW := FImgRight;
FWPObj.HeightTW:= FImgBotton;
WPRichText1.TextObjects.Insert(FWPObj);
WPRichText1.Refresh();
// Add blank space line
par := AWP.ActiveText.AppendPar;
par.SetText('');
end;

#1 ♥ 0
3.2k Views 2 users read 1 min
support

Hi,

you can use code like this

FWPObj := TWPOImage.Create(WPRichText1);
FWPObj.AssignBitmap(Image1.Picture.Graphic);
FWPObj.WidthTW := FImgRight;
FWPObj.HeightTW:= FImgBotton;

par := WPRichText1.TableRow.ChildPar; // First Cell
par.ClearText(true);
with par.InsertNewObject(0, wpobjImage, false, false, 0) do
begin
  ObjRef := FWPObj;
  Width :=  FWPObj.WidthTW;
  Height :=  FWPObj.HeightTW;
end;
WPRichText1.ReformatAll(false, false);

Regards,

Julian Ziersch

#2 ♥ 0
This category is archived. No new posts are possible.