[How to] How to save OLE objects in RTF

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply

Sergey Tkachenko
Site Admin
Posts: 13149
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Sep 29, 2009 9:16 am

I created a unit based on the code from the topic above.
http://www.trichview.com/support/files/ ... rtortf.zip

It contains the function

Code: Select all

function GetOleContainerRTFString(OleContainer: TOleContainer;
  Image: TMetafile = nil): String;
This function returns RTF representation of OleContainer for assigning to OutStr parameter of TRichView.OnSaveComponentToFile event:

Code: Select all

procedure TForm1.RichViewEdit1SaveComponentToFile(Sender: TCustomRichView;
  Path: String; SaveMe: TPersistent; SaveFormat: TRVSaveFormat;
  var OutStr: String);
begin
  case SaveFormat of
   ...
   rvsfRTF:
      begin
        if SaveMe is TOleContainer then
          OutStr := GetOleContainerRTFString(TOleContainer(SaveMe))
        ...
      end;
  end;
end;
The second parameter (Image) is optional. If assigned, this metafile will be used as an image representing this OleContainer. If not assigned, the function makes this image itself.

gary
Posts: 140
Joined: Wed Aug 31, 2005 1:36 pm

Post by gary » Mon Mar 09, 2015 3:05 am

Is there a same function for export ole to html?

Sergey Tkachenko
Site Admin
Posts: 13149
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Tue Mar 10, 2015 3:54 pm

I am not sure if it is possible at all.
HTML can include ActiveX controls, not OLE.

ActiveX is a programming code, while OLE object is data (such as a picture).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest