OLE stands for “Object Linking and Embedding”, a Microsoft technology that lets one document carry content produced by another application. For example, an Excel spreadsheet or a PowerPoint presentation can be embedded into a document edited in a word processor. All the related data then stays in one document, which is easy to share.
How to add an OLE object to a diagram
GroupDocs.Merger for Python via .NET embeds a document into a page of a Visio diagram in three steps:
Create an OleDiagramOptions with the path to the file to embed and the number of the diagram page to put it on.
Create a Merger with the path to the diagram, and call merger.import_document() with the options.
Call merger.save() with the path of the result.
The following example embeds a PowerPoint presentation into a Visio diagram:
fromgroupdocs.mergerimportMergerfromgroupdocs.merger.domain.optionsimportOleDiagramOptionsdefadd_document_to_diagram_via_ole():# Embed the presentation on page 2 of the diagram, in a 2 x 1 inch shape centred at (1, 1) inchpage_number=2ole_options=OleDiagramOptions("./embedded.pptx",page_number)ole_options.x=1ole_options.y=1ole_options.width=2ole_options.height=1withMerger("./input.vsdx")asmerger:merger.import_document(ole_options)merger.save("./output.vsdx")if__name__=="__main__":add_document_to_diagram_via_ole()
input.vsdx is a sample file used in this example. Click here to download it.
embedded.pptx is a sample file used in this example. Click here to download it.