Example output
Option Explicit
Const TITLE_SLIDE_LAYOUT As Integer = 1
Const CONTENT_SLIDE_LAYOUT As Integer = 2
Const IMAGE_SLIDE_LAYOUT As Integer = 6
Sub CreateClimateChangePresentation()
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim slide As PowerPoint.Slide
Dim slideIndex As Integer
Set pptApp = New PowerPoint.Application
pptApp.Visible = msoTrue
Set pptPres = pptApp.Presentations.Add
' Slide 1: Introduction
slideIndex = pptPres.Slides.Count + 1
Set slide = pptPres.Slides.Add(slideIndex, TITLE_SLIDE_LAYOUT)
slide.Shapes.Title.TextFrame.TextRange.Text = "The Impact of Climate Change on Wildlife"
slide.Shapes(2).TextFrame.TextRange.Text = "Understanding the Effects and Solutions"
' Slide 2: How Climate Change Affects Wildlife
slideIndex = pptPres.Slides.Count + 1
Set slide = pptPres.Slides.Add(slideIndex, CONTENT_SLIDE_LAYOUT)
slide.Shapes.Title.TextFrame.TextRange.Text = "How Climate Change Affects Wildlife"
slide.Shapes(2).TextFrame.TextRange.Text = "• Changes in temperature" & vbCrLf & " - Alteration of hibernation and migration patterns" & vbCrLf & "• Shifts in habitats" & vbCrLf & " - Loss of habitat or fragmentation" & vbCrLf & "• Altered food sources" & vbCrLf & " - Changes in availability or abundance of prey" & vbCrLf & "• Increased vulnerability to disease and invasive species" & vbCrLf & " - Weakening of immune systems, new predators, and competitors"
' Slide 3: Case Studies
slideIndex = pptPres.Slides.Count + 1
Set slide = pptPres.Slides.Add(slideIndex, CONTENT_SLIDE_LAYOUT)
slide.Shapes.Title.TextFrame.TextRange.Text = "Case Studies: Species at Risk"
slide.Shapes(2).TextFrame.TextRange.Text = "• Polar bears" & vbCrLf & " - Declining sea ice reduces hunting opportunities" & vbCrLf & "• Coral reefs" & vbCrLf & " - Ocean acidification and warming threaten coral ecosystems" & vbCrLf & "• Migratory birds" & vbCrLf & " - Timing mismatches with food sources and nesting habitats" & vbCrLf & "• Amphibians" & vbCrLf & " - Increased susceptibility to diseases, such as chytridiomycosis"
' Slide 4: What We Can Do to Help
slideIndex = pptPres.Slides.Count + 1
Set slide = pptPres.Slides.Add(slideIndex, CONTENT_SLIDE_LAYOUT)
slide.Shapes.Title.TextFrame.TextRange.Text = "What We Can Do to Help"
slide.Shapes(2).TextFrame.TextRange.Text = "• Reduce greenhouse gas emissions" & vbCrLf & " - Adopt cleaner energy sources, increase energy efficiency" & vbCrLf & "• Protect and restore habitats" & vbCrLf & " - Implement conservation strategies, reforest degraded areas" & vbCrLf & "• Support wildlife conservation organizations" & vbCrLf & " - Donate, volunteer, and participate in citizen science initiatives"