Here is the procedure I wrote:
procedure TForm.InsertPic(Sender: TObject);
var
obj : TWPOImage;
Resp : Integer;
se : String;
begin
OpenDialog.Filter := 'Bitmap/Jpeg/Gif/Wmf|*.bmp;*.jpg;*.gif;*.wmf';
OpenDialog.FileName := '';
If OpenDialog.Execute then
begin
se := Lowercase(ExtractFileExt(OpenDialog.FileName));
if (se = '.bmp') or (se = '.jpg') or (se = '.gif') or (se = '.wmf') then
begin
obj := TWPOImage.Create(VolgaEd.Memo.RTFData);
obj.LoadFromFile(OpenDialog.Filename);
obj.StreamName := OpenDialog.Filename;
obj.WriteRTFMode := wobBoth;
RichText1.TextObjects.Insert(obj);
end;
end;
end;
The graphic appears at the cursor, but only the text is saved. What am I missing?
BTW, essentially the same code worked nicely in WPTools3.
--Bill