View Single Post
 
Old 02-13-2021, 05:59 AM
AntonM AntonM is offline Windows 10 Office 2019
Novice
 
Join Date: Feb 2021
Posts: 2
AntonM is on a distinguished road
Default Referring to objects in running PowerPoint presentation

I am trying to verify the slide and shape clicked to then make varying things happen. I can make it work when the presentation is not running but not when it is. I guess it's because I am not referring to the correct container/object at that time, but can't figure out what it should be, so any help would be much appreciated.

here is a working snippet when the presentation is not running:

If (ActiveWindow.Selection.ShapeRange.Name) = "Playing card 1" Then
If (ActiveWindow.Selection.SlideRange.SlideID) = 283 Then
Set Target = ActivePresentation.Slides.FindBySlideID(279)
MsgBox ("This is the shape with a Card for Linus and target slide " & Target.SlideIndex)
End If
End If

Msgbox doesn't appear in presentation, if I add an errorhandler it always errors. I've tried ActivePresentation.Slides instead of ActiveWindow and various others without success.
Reply With Quote