• I am experimenting with the OLE support in WPTools. i insert a new object with the code

    obj := TWPOOLEBox.Create(Self);
    TWPOOLEBox(obj).OLEContainer.InsertObjectDialog;
    obj.WidthTW := 5000;
    obj.HeightTW := 3000;
    WPRichText1.TextObjects.Insert(obj);

    1. To display the OLE server I first have to click on an invisible container to display its outline, and then doubleclick to open the OLE server. Is it possible to open the server directly (like Word does)?

    2. When I save a document with an embedded OLE object (for instance an equation), the container is empty when I open the document again. How can I remedy this?

    3. To retain the size of the object which is created in the server, I suppose I have to inquire the server about the the width and height and change obj.WidthTW accordingly?

    4. Will the support for OLE change in v. 5?

    • Offizieller Beitrag

    The OLE support in WPTools is more for OLE objects read from input RTF files. Since V2.21 they are handled by the image object (not the OLE object) and the OLE information is preserved.

    Any OLE support you mention requires some extra code outside of the control which opens the OLE application to render the image, creates OLE streams etc. Currently te OLE container uses a proprietary format and is not ideal. The OLE format for embedded objects is not documented by MS and so it is quite difficult to create correct streams.

    I hope I can create an example which inserts a true OLE object into the text for V5. It will not be in the RTF-Engine since Delphi 8 does not have the OLE container as far as I know.

    Julian Ziersch

  • >I hope I can create an example which inserts a true OLE object into the text for V5.

    In the meantime, could you tell me how to save the OLE info with the document? The "Impressive Sample wordprocessor" does this, but I don't have the source code for this program.

  • Thank you.

    However, the source code seems to be for an older version, which does not include the Insert, OLE object menu.

    It seems not to be sufficient to set the ObjectWritingMode to Standard. The OLE object is still not saved, only an empty container.