Main Content

Generate a Presentation

To generate a PowerPoint® presentation from your PPT API program, use the API to close the presentation. For example, to generate a presentation whose Presentation object is slides:

close(slides);

Generating a presentation overwrites the previous version of the presentation file. Closing a presentation creates or overwrites a .pptx file in the path that you specify in the Presentation object constructor. For example, closing this presentation creates a MyPresentation.pptx file in the current folder:

import mlreportgen.ppt.*;
slides = Presentation('MyPresentation');
add(slides,'Title and Content');
close(slides);

Note

If the presentation (.pptx) file is already open in PowerPoint, interactively close the PowerPoint presentation file before you generate the presentation using the PPT API program.

Related Topics