Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

PPTools

Image Export converts PowerPoint slides to high-quality images.

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

FixLinks prevents broken links when you distribute PowerPoint presentations

Optimizer saves disk space and bandwidth, "right-sizes" your PowerPoint presentations for email, screenshow or printing

PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF

Determine which shape was clicked

Visit MVP Shyam Pillai's site for example code that shows you how to determine programmatically which shape was clicked.

Note that you can modify the code to get a reference to the slide the shape is on:

oShp.Parent returns a reference to the slide the shape is on
oShp.Parent.Name returns the name of the slide
oShp.Parent.SlideID returns the SlideID

Here's an example:

Sub ToggleVisibility(oShape As Shape)
    oShape.Visible = Not oShape.Visible
End Sub

Rightclick a shape in PowerPoint, choose Action Settings, Run Macro and pick ToggleVisibility to assign this macro to the shape's Click event.

Then when you run the slide show and click the shape, it'll become invisible.

You could modify the code to make some other shape visible or invisible instead. For example if you have a shape on Slide 1 named "Popup" , assign this macro to its MouseOver Action and it'll appear/disappear as you wave the mouse over it during a screen show:

Sub PopUp(oShape As Shape)

    ActivePresentation.Slides(1).Shapes("Popup").Visible = _
        Not ActivePresentation.Slides(1).Shapes("Popup").Visible

End Sub

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2011 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.
Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Determine which shape was clicked
http://www.pptfaq.com/FAQ00141_Determine_which_shape_was_clicked.htm
Last update 07 June, 2011
Created: