Saving TOLEContainers from TRichView to RTF file:
http://www.trichview.com/forums/viewtopic.php?t=108
[How to] How to save OLE objects in RTF
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I created a unit based on the code from the topic above.
http://www.trichview.com/support/files/ ... rtortf.zip
It contains the function
This function returns RTF representation of OleContainer for assigning to OutStr parameter of TRichView.OnSaveComponentToFile event:
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.
Update:
2018-Apr-20: for compatibility with TRichView 17.3 (for older versions, change the type of OutStr parameter to String
http://www.trichview.com/support/files/ ... rtortf.zip
It contains the function
Code: Select all
function GetOleContainerRTFString(OleContainer: TOleContainer;
Image: TMetafile = nil): String;
Code: Select all
procedure TForm1.RichViewEdit1SaveComponentToFile(Sender: TCustomRichView;
Path: String; SaveMe: TPersistent; SaveFormat: TRVSaveFormat;
var OutStr: TRVUnicodeString);
begin
case SaveFormat of
...
rvsfRTF:
begin
if SaveMe is TOleContainer then
OutStr := GetOleContainerRTFString(TOleContainer(SaveMe))
...
end;
end;
end;
Update:
2018-Apr-20: for compatibility with TRichView 17.3 (for older versions, change the type of OutStr parameter to String
-
- Site Admin
- Posts: 17534
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: