Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2021, 05:59 AM
AntonM AntonM is offline Referring to objects in running PowerPoint presentation Windows 10 Referring to objects in running PowerPoint presentation Office 2019
Novice
Referring to objects in running PowerPoint presentation
 
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
  #2  
Old 02-13-2021, 07:45 AM
JohnWilson JohnWilson is offline Referring to objects in running PowerPoint presentation Windows 10 Referring to objects in running PowerPoint presentation Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

You cannot have a selection in show mode

You need to assign a macro to the shapes when clicked with Insert Action

Code:
Sub clicked_shape(oshp As Shape)
MsgBox "Shape:= " & oshp.Name & " Slide #=" & oshp.Parent.SlideIndex
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 02-13-2021, 09:35 AM
AntonM AntonM is offline Referring to objects in running PowerPoint presentation Windows 10 Referring to objects in running PowerPoint presentation Office 2019
Novice
Referring to objects in running PowerPoint presentation
 
Join Date: Feb 2021
Posts: 2
AntonM is on a distinguished road
Default

Thank you so much, works perfectly. Following your advice elsewhere, I substituted .SlideIndex for .SlideID so that it was unique allowing for inevitable jumbling of slides whilst the presentation is edited.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Update Excel info in running Presentation crimedog PowerPoint 0 04-20-2017 01:53 PM
Objects On a Motion Path Running Over a Playing Video Background Which Will Not Run sprdeagle PowerPoint 0 03-30-2016 05:42 PM
embed a powerpoint presentation within another presentation rundownbassman92 PowerPoint 3 08-21-2014 03:13 AM
Referring to objects in running PowerPoint presentation How to scroll down the slide while presentation running? aditya_bokade PowerPoint 6 08-12-2012 12:09 AM
Table update in running presentation rumdrum PowerPoint 0 02-10-2011 01:28 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft