Supercharge your PowerPoint productivity with

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

Tell me about PPTools

Determine which shape was clicked


PPTools
Shape Styles brings the power of styles to PowerPoint. Apply complex formatting with a single click
Merge Excel, CSV or tab-delimited 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, shrinks your PowerPoint presentations to the right size 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
Image Export converts PowerPoint slides to JPG, PNG, GIF, WMF and more

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.


Page copy protected against web site content infringement by Copyscape Contents © 1995-2008 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.htm
Last update 09 September, 2006