Sub
UseMsoAnimEffectPlayVideoFromBookmark()
Dim oShp As Shape ' Shape trigger
Dim oShpMovie As Shape ' Media shape
With ActivePresentation.Slides(1).Shapes
Set oShpMovie = .AddMediaObject2("C:\Videos\sample.wmv", False, True)
Set oShp = .AddShape(msoShapeRectangle, 10, 10, 100, 50)
End With
With ActivePresentation.Slides(1)
' Create three bookmarks on the video at desired points
Call oShpMovie.MediaFormat.MediaBookmarks.Add(10000, "Bookmark A")
Call oShpMovie.MediaFormat.MediaBookmarks.Add(20000, "Bookmark B")
Call oShpMovie.MediaFormat.MediaBookmarks.Add(30000, "Bookmark C")
' Create an animation sequence to start playing playing from the second bookmark
' When you use the msoAnimEffectMediaPlayFromBookmark enum value PowerPoint assigns
' the first bookmark as the starting point for the video, to change that you need
' to edit the bookmark property
With .TimeLine.MainSequence.AddEffect(oShpMovie, msoAnimEffectMediaPlayFromBookmark)
.Behaviors(1).CommandEffect.bookmark = "Bookmark B"
End With
' Create a shape trigger to start playing from the third book.
' Don't set the bookmark name in the AddTriggerEffect call, it will be ignored
With .TimeLine.InteractiveSequences.Add.AddTriggerEffect(oShpMovie, _
msoAnimEffectMediaPlayFromBookmark, _
msoAnimTriggerOnShapeClick, oShp)
.Behaviors(1).CommandEffect.bookmark = "Bookmark C"
End With
End With
End Sub