How to start a Powerpoint presentation using ACT?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 457
100 Answers 250 Likes 100 Comments Second Anniversary
✭✭✭✭
edited June 2023 in Structures

Start a presentation in ACT Console.

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 457
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    Answer ✓

    This can be done by importing Microsoft.Office.Interop.PowerPoint library.

    # Import Powerpoint Lib.
    import clr
    clr.AddReference("Microsoft.Office.Interop.PowerPoint")
    import Microsoft.Office.Interop.PowerPoint as PowerPoint
    # Create powerpoint application
    powerpoint = PowerPoint.ApplicationClass()
    powerpoint.Visible = True
    # Add presentation to the application
    presentation=powerpoint.Presentations.Add()
    # Save the presentation
    presentation.SaveAs(r"D:\Path\to\myppt.pptx", PowerPoint.PpSaveAsFileType.ppSaveAsDefault)