Facebook Pixel

How to Create a PowerPoint Presentation Using ChatGPT and VBA

Have you ever wondered how to automate the creation of a PowerPoint presentation? In this article, we’ll explore how ChatGPT, a language model developed by OpenAI, can be used in tandem with PowerPoint to quickly generate slides. You will also watch the video on our YouTube page .

Step 1: Discover ChatGPT

ChatGPT is a language model based on OpenAI’s GPT-4 architecture. It is capable of understanding and generating text in a multitude of languages. With ChatGPT you can get answers to your questions, generate content or even write code!

Step 2: Open PowerPoint and VBA Editor

Before using the code generated by ChatGPT, you need to prepare PowerPoint:

  1. Open PowerPoint.
  2. Press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.
  3. In the editor, click Insert > Module to add a new module.

Step 3: Use ChatGPT to Get VBA Code

Simply ask your question to ChatGPT. In our example, we asked how to create a PowerPoint presentation that details the steps for creating a WordPress site. ChatGPT provided us with ready-to-use VBA code. You can, for example, ask ChatGPT to create VBA code on how to create a website with WordPress . You will have code similar to this.


Sub CreerPresentationWordPress()

    Dim pptApp As Object
    Dim pptPresentation As Object
    Dim pptSlide As Object
    Dim pptTextBox As Object
    Dim i As Integer
    
    ' Crée une nouvelle instance de PowerPoint ou utilise une instance ouverte
    On Error Resume Next
    Set pptApp = GetObject(, "PowerPoint.Application")
    On Error GoTo 0
    
    If pptApp Is Nothing Then
        Set pptApp = CreateObject("PowerPoint.Application")
    End If
    
    ' Crée une nouvelle présentation
    Set pptPresentation = pptApp.Presentations.Add
    pptApp.Visible = True
    
    ' Tableau des étapes pour créer un site WordPress
    Dim etapes() As String
    etapes = Split("Choisir un nom de domaine et un hébergeur,Installer WordPress sur votre hébergement,Choisir un thème pour votre site,Installer les plugins nécessaires,Créer les pages de base (Accueil, À propos, Contact, etc.),Ajouter du contenu à ces pages,Personnaliser votre site (couleurs, polices, etc.),Configurer les paramètres de SEO,Tester le site pour s'assurer qu'il fonctionne correctement,Publier le site", ",")
    
    ' Crée une diapositive pour chaque étape
    For i = LBound(etapes) To UBound(etapes)
        
        ' Ajoute une nouvelle diapositive
        Set pptSlide = pptPresentation.Slides.Add(i + 1, 1) ' 1 = ppLayoutTitle (layout avec titre et contenu)
        
        ' Définit le titre et le contenu de la diapositive
        pptSlide.Shapes(1).TextFrame.TextRange.Text = "Étape " & (i + 1)
        pptSlide.Shapes(2).TextFrame.TextRange.Text = etapes(i)
        
    Next i

End Sub

Step 4: Copy and paste the VBA code

Once you have your code:

  1. Copy the VBA code provided by ChatGPT.
  2. Paste it into the module you created in step 2.

Step 5: Run the macro

With the code in place, you can now run the macro to generate your presentation:

  1. Close the VBA editor.
  2. In PowerPoint, press ALT + F8 , select your macro (in our example, CreerPresentationWordPress ) and click “Run.”

So! PowerPoint will automatically generate a series of slides based on the code ChatGPT provided to you.

Conclusion

ChatGPT and PowerPoint integration provides an innovative and fast way to create presentations. Whether you’re a professional looking to save time or a student looking to impress, this method offers you a huge advantage. Try it the next time you need to create a presentation in a snap!

Gilblas Ngunte Possi

Gilblas Ngunte Possi

Founder and Full-Stack Developer at Prositeweb.

My proficiency with modern tools and a keen analytical sense regarding information technology enable me to provide superior guidance in the development and implementation of your web solutions.

Gilblas Ngunte Possi

Gilblas
Typically replies within an hour

Gilblas
Hi there👋

How can I help you?
1:40
Chat with Us