How to Best Automate and Conquer Your Whopping PowerPoint Slide Needs

In today’s digital landscape, creating automations to improve workflows and efficiencies is crucial. With the rising popularity of ChatGPT and generative AI, more and more professionals are finding innovative ways to gain an edge (and here’s how you can use ChatGPT for content without being generic).

In this blog, I’m going to demonstrate how to automate PowerPoint presentations using ChatGPT to generate VBA code. This post was inspired by a LinkedIn post conversation with Wil Reynolds, who asked his network for suggestions on how to use AI to improve presentations and communications.

What’s cool about this is that you don’t need to be an expert on VBA code. If you can follow short step-by-step instructions, you’ll be good to go!

In another post I dive into how to use ChatGPT to assist with visual content.

How Is This Useful?

Use Case: repurposing my content. If I take one (or several) of my blogs, I can quickly reformat it into a presentation.

Check it out for yourself:

Step-by-Step Guide to Automating PowerPoint with ChatGPT

  1. ChatGPT Prompting: Open a new ChatGPT chat and enter your prompt along with labels and text for each slide. See the prompt I used below.
  2. VBA Code Generation: Upon feeding the above prompt to ChatGPT, it returns with a VBA code specifically tailored for PowerPoint. This code will be used to automate the PowerPoint creation process. See the VBA code it provided below the prompt example.
  3. Integrating VBA into PowerPoint: a. Open PowerPoint. b. Press Alt + F11. This will open the VBA editor inside PowerPoint. c. Navigate to Insert > Module. This action will create a new module. d. Once the new module is open, paste the VBA code that ChatGPT generated for you. e. Save your work by hitting the save icon or by pressing Ctrl + S.
  4. Executing the VBA Code: With the code now in place, run the code by pressing the green “Play” button or hitting F5. Boom! Watch as PowerPoint populates your slides using the imported text.

My Prompt Example

Write this into a VBA code for PowerPoint:

---

## title: "The Rise of the Eagles: The Journey to the 2018 Super Bowl"

---

slide: 1
title: "Introduction"
content:

- The Eagles' remarkable journey.
- The underdog story that captured America.

---

---

slide: 2
title: "The Head Coach: Doug Pederson"
content:

- Hired in 2016, Pederson's leadership transformed the team.
- Created a dynamic and aggressive offensive strategy.
- Fostered a tight-knit team culture.

---

---

slide: 3
title: "Carson Wentz's Stellar Season"
content:

- Drafted 2nd overall in 2016.
- In 2017, threw for 33 touchdowns in just 13 games.
- A frontrunner for MVP before his injury.

---

---

slide: 4
title: "The Backup's Rise: Nick Foles"
content:

- Stepped up after Wentz's injury.
- Had previous success with the Eagles in 2013.
- Played some of the best football of his career in the playoffs.

---

---

slide: 5
title: "Defensive Dominance"
content:

- Ranked 4th in total defense.
- Fletcher Cox led a formidable front.
- Malcom Jenkins provided veteran leadership in the secondary.

---

---

slide: 6
title: "Offseason Acquisitions"
content:

- Acquired key pieces like Alshon Jeffery and LeGarrette Blount.
- Trades and free agent signings provided depth and talent.
- Front office's shrewd moves set the team up for success.

---

---

slide: 7
title: "The 'Philly Special'"
content:

- Trick play in the Super Bowl that defined their aggressive approach.
- Foles caught a touchdown pass on 4th down.
- Embodied the team's fearless attitude.

---

---

slide: 8
title: "Overcoming Adversity"
content:

- Many key players faced injuries throughout the season.
- The "next man up" mentality prevailed.
- Overcame the underdog label to triumph.

---

---

slide: 9
title: "The Super Bowl LII Win"
content:

- Faced the New England Patriots.
- High-scoring game ended 41-33.
- First Super Bowl win in franchise history.

---

---

slide: 10
title: "Conclusion"
content:

- A season of trials and triumphs.
- A true team victory – from the front office to the players.
- A historic moment for Philadelphia and its fans.

VBA Code Provided by ChatGPT

Sub GeneratePresentation()

    ' Declare variables
    Dim pptApp As Object
    Dim pptPresentation As Object
    Dim pptSlide As Object
    Dim pptTextbox As Object
    Dim slideIndex As Integer
    Dim contentIndex As Integer

    ' Create a new PowerPoint application and presentation
    Set pptApp = CreateObject("PowerPoint.Application")
    pptApp.Visible = True
    Set pptPresentation = pptApp.Presentations.Add

    ' Set presentation title
    pptPresentation.Slides.Add 1, 1 ' Slide 1
    pptPresentation.Slides(1).Shapes(1).TextFrame.TextRange.Text = "The Rise of the Eagles: The Journey to the 2018 Super Bowl"

    ' Add the content
    For slideIndex = 1 To 10

        ' Add a new slide
        Set pptSlide = pptPresentation.Slides.Add(slideIndex + 1, 1)

        ' Slide titles and content
        Select Case slideIndex

            Case 1
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Introduction"
                Content = Array("The Eagles' remarkable journey.", "The underdog story that captured America.")

            Case 2
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "The Head Coach: Doug Pederson"
                Content = Array("Hired in 2016, Pederson's leadership transformed the team.", "Created a dynamic and aggressive offensive strategy.", "Fostered a tight-knit team culture.")

            Case 3
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Carson Wentz's Stellar Season"
                Content = Array("Drafted 2nd overall in 2016.", "In 2017, threw for 33 touchdowns in just 13 games.", "A frontrunner for MVP before his injury.")

            Case 4
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "The Backup's Rise: Nick Foles"
                Content = Array("Stepped up after Wentz's injury.", "Had previous success with the Eagles in 2013.", "Played some of the best football of his career in the playoffs.")

            Case 5
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Defensive Dominance"
                Content = Array("Ranked 4th in total defense.", "Fletcher Cox led a formidable front.", "Malcom Jenkins provided veteran leadership in the secondary.")

            Case 6
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Offseason Acquisitions"
                Content = Array("Acquired key pieces like Alshon Jeffery and LeGarrette Blount.", "Trades and free agent signings provided depth and talent.", "Front office's shrewd moves set the team up for success.")

            Case 7
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "The 'Philly Special'"
                Content = Array("Trick play in the Super Bowl that defined their aggressive approach.", "Foles caught a touchdown pass on 4th down.", "Embodied the team's fearless attitude.")

            Case 8
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Overcoming Adversity"
                Content = Array("Many key players faced injuries throughout the season.", "The ""next man up"" mentality prevailed.", "Overcame the underdog label to triumph.")

            Case 9
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "The Super Bowl LII Win"
                Content = Array("Faced the New England Patriots.", "High-scoring game ended 41-33.", "First Super Bowl win in franchise history.")

            Case 10
                pptSlide.Shapes(1).TextFrame.TextRange.Text = "Conclusion"
                Content = Array("A season of trials and triumphs.", "A true team victory – from the front office to the players.", "A historic moment for Philadelphia and its fans.")

        End Select

        ' Add content to slide
        For contentIndex = LBound(Content) To UBound(Content)
            Set pptTextbox = pptSlide.Shapes.AddTextbox(Orientation:=1, Left:=100, Top:=100 + (contentIndex * 50), Width:=600, Height:=40)
            pptTextbox.TextFrame.TextRange.Text = Content(contentIndex)
        Next contentIndex

    Next slideIndex

    ' Clean up
    Set pptSlide = Nothing
    Set pptPresentation = Nothing
    Set pptApp = Nothing

End Sub

In Conclusion

The future possibilities for improving workflows appear to be limitless, as generative AI will only get better.

How have you leveraged ChatGPT and other generative AI to enhance your workflows?

Share your experiences, tips, or challenges in the comments below!

Join the 16,000+ people I’m predicting, optimistically to the point of silliness, will see this blog someday… and get my updates straight to your inbox!

Get New Post Updates!

Published by

Bryan Kofsky

Bryan Kofsky, a Sales System Engineer and technology enthusiast, expertly navigates the intersection of marketing, sales, and AI-driven automation. Currently revolutionizing sales at MDT Marketing, he's a certified HubSpot Solutions Partner and Google Certified Professional. Beyond his professional life, Bryan explores home automation and literature, inviting you to join his journey through his insightful blog.

Leave a Reply

Your email address will not be published. Required fields are marked *