How to start a Powerpoint presentation using ACT?

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 389
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures

Start a presentation in ACT Console.

Tagged:

Answers

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 389
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    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)