Generates VBA code to automatically create a PowerPoint presentation on any topic, with a specified number of slides.
Stop building presentations from scratch! The PowerPoint VBA Code Generator instantly creates the VBA (Visual Basic for Applications) script needed to automatically build a complete PowerPoint presentation. Simply define your topic, the number of slides, and the expert persona you want the content written from, and this prompt will generate the code. Just copy, paste, and run the script in PowerPoint to have a fully-formed draft presentation in seconds.
This prompt is a game-changer for productivity. It completely automates the tedious, time-consuming task of creating presentation content and structure. By generating clean, ready-to-use VBA code, it saves you hours of manual work. This allows you to focus on refining the message and design, rather than building slides one by one. It provides a powerful, functional code base that can be easily customized for even more complex automation tasks.
Sub CreateAIPresentation()
Dim pptApp As Object
Dim pptPres As Object
Dim pptSlide As Object
Dim slideCount As Integer
' Create a new PowerPoint instance
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
' Create a new presentation
Set pptPres = pptApp.Presentations.Add
' Slide 1: Title Slide
Set pptSlide = pptPres.Slides.Add(1, 1) ' ppLayoutTitle
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "The Impact of AI on Modern Marketing"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "By a Senior Data Scientist"
' Slide 2: Introduction
Set pptSlide = pptPres.Slides.Add(2, 2) ' ppLayoutText
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "What is AI in Marketing?"
pptSlide.Shapes.Item(2).TextFrame.TextRange.Text = "- AI refers to the use of machine learning..."
' ... more slides would be generated here ...
End Sub
Variable Name | Label | Purpose & Example |
---|---|---|
PRESENTATION_TOPIC | Presentation Topic | Purpose: To define the subject matter of the presentation. Example: "The Impact of AI on Modern Marketing" |
EXPERT_ROLE | Expert Role for Content | Purpose: To guide the AI on the perspective and tone to use when writing the slide content. Example: "Senior Data Scientist" or "Creative Director" |
SLIDE_COUNT | Number of Slides | Purpose: To specify the total number of slides the generated code should create. Example: 15 |
SYSTEM_OUTPUT_LANGUAGE | Slide Content Language | Purpose: To set the language for the text that will appear on the slides. Example: Select 'German' for a presentation in Berlin. |
Prompts specifically for generating code snippets, functions, or even entire scripts in various programming languages.
Get started with PromptPlex extension for seamless prompt management.