Add document to Presentation via OLE

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Merger MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-merger -- dnx GroupDocs.Merger.Mcp --yes
Folders, licensing and more →

What is OLE object for Presentation?

The “Object Linking and Embedding” technology helps to embed some other document in the currently editing Presentation one. For this case, the frame object is using for the embedded document content. The Word and PDF documents, Excel and Oped Document format spreadsheets and other document types can be embedded in a PowerPoint presentation as frame that is predefined with X and Y coordinates and it’s size.

Add document to Presentation via OLE

GroupDocs.Merger provides an ability to add other single document as embedded document to Presentation. 
Here are the steps for it:

The following code sample demonstrates how to add other single document as embedded document to Presentation:

string filePath = @"c:\sample.ppt";
string filePathEmbedded = @"c:\embedded.pdf";
string filePathOut = @"c:\output\result.ppt";

int pageNumber = 2;
OlePresentationOptions olePresentationOptions = new OlePresentationOptions(filePathEmbedded, pageNumber);
olePresentationOptions.X = 10;
olePresentationOptions.Y = 10;

using (Merger merger = new Merger(filePath))
{
    merger.ImportDocument(olePresentationOptions);
    merger.Save(filePathOut);
}