Sub CreateEventManagementPresentation()
Dim pptApp As Object
Dim pptPres As Object
Dim slideIndex As Integer
Dim imagePath As String
Dim videoPath As String
' Create new instance of PowerPoint application
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
' Create a new presentation
Set pptPres = pptApp.Presentations.Add
' Set the paths to your images and videos
imagePath = "C:\path\to\your\images\" ' Change this path
videoPath = "C:\path\to\your\videos\" ' Change this path
' Slide 1: Title Slide
slideIndex = slideIndex + 1
With pptPres.Slides.Add(slideIndex, 1) ' 1 for ppLayoutTitle
.Shapes(1).TextFrame.TextRange.Text = "Event Management Course"
.Shapes(2).TextFrame.TextRange.Text = "Related Topics"
End With
' Slide 2: Introduction
slideIndex = slideIndex + 1
With pptPres.Slides.Add(slideIndex, 2) ' 2 for ppLayoutText
.Shapes(1).TextFrame.TextRange.Text = "Introduction to Event Management"
.Shapes(2).TextFrame.TextRange.Text = "Event management involves planning, organizing, and
executing various types of events."
End With
' Slide 3-6: Image Slides
For i = 3 To 6
slideIndex = slideIndex + 1
With pptPres.Slides.Add(slideIndex, 3) ' 3 for ppLayoutTextAndMedia
' Add image
.Shapes.AddPicture Filename:=imagePath & "image" & (i - 2) & ".jpg", LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, Left:=100, Top:=100, Width:=400, Height:=300
' Add text
.Shapes(2).TextFrame.TextRange.Text = "Image " & (i - 2)
End With
Next i
' Slide 7-9: Video Slides
For i = 7 To 9
slideIndex = slideIndex + 1
With pptPres.Slides.Add(slideIndex, 3) ' 3 for ppLayoutTextAndMedia
' Add video
.Shapes.AddMediaObject2 FileName:=videoPath & "video" & (i - 6) & ".mp4",
LinkToFile:=msoFalse, _
SaveWithDocument:=msoTrue, Left:=100, Top:=100, Width:=400, Height:=300
' Add text
.Shapes(2).TextFrame.TextRange.Text = "Video " & (i - 6)
End With
Next i
' Slide 10: Conclusion
slideIndex = slideIndex + 1
With pptPres.Slides.Add(slideIndex, 2) ' 2 for ppLayoutText
.Shapes(1).TextFrame.TextRange.Text = "Conclusion"
.Shapes(2).TextFrame.TextRange.Text = "In conclusion, event management is a crucial aspect of
organizing successful events."
End With
' Clean up
Set pptPres = Nothing
Set pptApp = Nothing
End Sub