Use the following ChatGPT message to get the VBA script.
I want you to write me VBA code for a PowerPoint presentation about the history of computers. You are to fill in all the text with your own knowledge, no placeholders, I need 5 slides.
or
I want you to write me VBA code for a PowerPoint presentation about the history of computers. You are to fill in all the text with your own knowledge, heading and content, no placeholders, I need 5 slides.
Here, the PowerPoint presentation topic is the history of computers, and the slide count is 5. You can change the topic and slide count as per your requirements.
The following VBA code will be generated: Use the instructions listed below this code to generate the PowerPoint presentation.
Sub CreateAIPresentation()
Dim pptApp As Object
Dim pptPresentation As Object
Dim pptSlide As Object
Dim pptShape As Object
' Create a new PowerPoint application
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
' Add a new presentation
Set pptPresentation = pptApp.Presentations.Add
' Slide 1 - Title
Set pptSlide = pptPresentation.Slides.Add(1, ppLayoutTitle)
Set pptShape = pptSlide.Shapes(1)
pptShape.TextFrame.TextRange.Text = "The History of Artificial Intelligence"
' Slide 2 - Introduction
Set pptSlide = pptPresentation.Slides.Add(2, ppLayoutText)
Set pptShape = pptSlide.Shapes(1)
pptShape.TextFrame.TextRange.Text = "Introduction to AI"
pptSlide.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=10, Top:=100, Width:=450, Height:=300).TextFrame.TextRange.Text = "Artificial Intelligence, or AI, is a multidisciplinary field of computer science that aims to create machines and software capable of intelligent behavior. It has a rich history and has evolved significantly over the years."
' Slide 3 - Early Beginnings
Set pptSlide = pptPresentation.Slides.Add(3, ppLayoutText)
Set pptShape = pptSlide.Shapes(1)
pptShape.TextFrame.TextRange.Text = "Early Beginnings"
pptSlide.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=10, Top:=100, Width:=450, Height:=300).TextFrame.TextRange.Text = "The history of AI can be traced back to ancient times when humans first attempted to create mechanical devices that could mimic human intelligence. However, modern AI research began in the mid-20th century with the development of the first computers and the emergence of digital computing."
' Slide 4 - Key Milestones
Set pptSlide = pptPresentation.Slides.Add(4, ppLayoutText)
Set pptShape = pptSlide.Shapes(1)
pptShape.TextFrame.TextRange.Text = "Key Milestones in AI History"
pptSlide.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=10, Top:=100, Width:=450, Height:=300).TextFrame.TextRange.Text = "Some key milestones in the history of AI include the development of the Turing machine by Alan Turing, the creation of the term 'Artificial Intelligence' at the Dartmouth Workshop in 1956, and breakthroughs in machine learning and neural networks."
' Slide 5 - Recent Advances
Set pptSlide = pptPresentation.Slides.Add(5, ppLayoutText)
Set pptShape = pptSlide.Shapes(1)
pptShape.TextFrame.TextRange.Text = "Recent Advances in AI"
pptSlide.Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, _
Left:=10, Top:=100, Width:=450, Height:=300).TextFrame.TextRange.Text = "In recent years, AI has witnessed remarkable advancements, including deep learning, natural language processing, and computer vision. These breakthroughs have led to practical applications of AI in various industries, such as healthcare, finance, and self-driving cars."
' Clean up
Set pptApp = Nothing
Set pptPresentation = Nothing
Set pptSlide = Nothing
Set pptShape = Nothing
End Sub
To use this code:
- Open PowerPoint.
- Press
Alt + F11
to open the VBA editor. - In the VBA editor, go to
Insert -> Module
to insert a new module. - Copy and paste the above VBA code into the module.
- Close the VBA editor.
- To run the code, go to
View -> Macros
, select “CreateAIPresentation,” and click “Run.”
This code will create a PowerPoint presentation with 5 slides, each containing headings and content about the history of computers. You can further customize the formatting, layout, and content as needed.