trichview.com

trichview.support




Re: I cannot Import/Export any OLE objects from/to RTF?


Return to index


Author

Message

David Michael

Posted: 04/23/2004 4:20:43


I don't know how to do an export of OLE objects to RTF, but importing isn't

that hard. It boils down to using the IRichEditOle interface.


1. You load the RTF into an OLE-enabled rich edit.

2. Using the IRichEditOle interface, see how many objects are in the rich

edit.

3. Again using the IRichEditOle interface, loop through the objects.

4. If the object responds to OleRun(), extract it from the RTF, stuff it

into a TOleContainer and insert it into the RVE.


I suppose you could do something similar in reverse, moving the text and

objects from RVE to RTF, but I haven't tried it.


Hope that helps.


-David

http://www.davidrm.com


"Zhangzhi" <[email protected]> wrote in message

news:[email protected]...

>

> I see Insert ole objetct as  to Richview!

> --------------------------------

> var oc: TOleContainer;

>     created: Boolean;

> begin

>   oc := TOleContainer.Create(nil);

>   oc.Visible := False;

>   oc.BorderStyle := bsNone;

>   oc.Parent := RichViewEdit1;

>   created := True;

>   try

>     oc.CreateObject( 'Equation.3', False);

>   except

>     try

>       oc.CreateObject( 'Equation.2', False);

>     except

>       try

>         oc.CreateObject( 'Equation', False);

>       except

>         created := False;

>       end;

>     end;

>   end;

>   if not created then begin

>     oc.Free;

>     exit;

>   end;

>   oc.SizeMode := smAutoSize;

>   oc.OnResize := OnOleResize;

>   oc.OnActivate := OnOleActivate;

>   oc.OnDeactivate := OnOleDeactivate;

>   oc.Visible := True;

>   oc.OnMouseUp := OnOleMouseUp;

>   RichViewEdit1.InsertControl('', oc,rvvaBaseline);

> --------------------------------

>

> but TRichView not save/load the ole object from/to RTF?





Powered by ABC Amber Outlook Express Converter