Select Page

ActivePresentation Designer* Support

*obsolete product

Clicking Popup Groups to Hide Them

Thanks to the fact that the Popups feature uses embedded code within a presentation, it’s possible to extend the capabilities of the Popup feature.

Scenario

One such example is to overcome the Microsoft PowerPoint restriction that prevents you from clicking on the Popup to make it disappear if the popup is a group.

In this case, Microsoft PowerPoint does not support the application of Hyperlinks or Actions to grouped objects so we need an alternative way to clear a popup (by clicking on it) if it is a group.

Solution

By adding one of the following procedures to your presentation project, you may set an invisible shape on your slide to act as the trigger to a macro which makes all popups invisible on that slide.

The two procedures behave as follows so choose which one you need:

HideAllPopupsThisSlideByTag

  • Best failsafe method
  • Requires no change to your content
  • Search & Hide takes longer so there is a slight delay when clearing popups
  • Will hide any Popup created by ActivePrez (you don’t have any control flexibility)

HideAllPopupsThisSlideByName

  • Requires that all popups you want to be hidden are renamed in PowerPoint
  • You have more control due to the point above
  • Search & Hide is faster
  • Will get broken if an author changes the object names
  • You have to remember to rename groups if they are ungrouped and regrouped

Follow these steps to add one or both of the procedures show at the end of this article:

  1. Make sure that you have the develop tab enabled in your PowerPoint ribbon
    • In the PowerPoint Backstage, select Options
    • Click Customize Ribbon
    • Tick the Developer checkbox in the right hand list>/li>
    • Click OK
  2. Open your PowerPoint .pptm project file
  3. Open the VBA environment
    • Click the Developer tab in the PowerPoint ribbon
    • Click the Visual Basic button on the far left
  4. Expand the code modules in the VBA project
    • In the project tree in the top left of the editor, click the + symbols until the tree is fully expanded
  5. Paste the macro code from below at the end of the existing code in the APDPopupModule
  6. Save the file and Close the VBA editor
  7. Create the ‘Clear all Popups’ macro trigger shape
    • Add a shape (rectangle) over the popup area and set Line to none and Fill transparency to 99%
    • With this shape selected, from the ribbon, click Insert followed by Action
    • In the Mouse Click tab, set the Run Macro to HideAllPopupsThisSlideByName orHideAllPopupsThisSlideByTag as required
  8. Only if using the HideAllPopupsThisSlideByName function, for each popup that is to be hidden by the clear all function, set its name (in the Selection and Visibility pane) to include the text “APD Popup” (this can be a group or individual object) eg. “APD Popup” or “APD Popup : My popup object” or “This is an APD Popup”
  9. Run the slide show and with one or more popups activated, click the Clear all Popups shape/area to make all popups disappear on the current slide only

IMPORTANT NOTE : If you use ActivePrez to disable and then re-enable Popups, the above changes will be discarded and the steps 5-9 will have to be repeated.

Macro Code


Sub HideAllPopupsThisSlideByTag()
' ==================================================================
' Macro to set all ActivePresentation Designer popups to invisible<
' based on the Tag of the popup object (group, shape, picture etc.)
' Requirements : must be executed in slide show mode only
' Author : Jamie Garroch
' Date : 11 April 2012
' Version : 1.0
' Copyright : GMARK Ltd. 2012
' ==================================================================
 Dim Sld As PowerPoint.Slide
 Dim Shp As PowerPoint.Shape
 Dim S As String
 Dim PopupId As Long
 Dim PopupShp As PowerPoint.Shape
 Dim CurrentSlide As Integer

On Error Resume Next
 
 CurrentSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
 
 Set Sld = ActivePresentation.Slides(CurrentSlide)
 
 For Each Shp In Sld.Shapes
 S = Shp.Tags("POPUP_SHAPE_ID")
 If S <> "" Then
 PopupId = CLng(S)
 Set PopupShp = FindShapeById(Sld.Shapes, PopupId)
 If Not (PopupShp Is Nothing) Then
 PopupShp.Visible = False
 End If
 End If
 Next
End Sub

Sub HideAllPopupsThisSlideByName()
' ==================================================================
' Macro to set all ActivePresentation Designer popups to invisible
' based on the Name of the popup object (group, shape, picture etc.)
' Author : Jamie Garroch
' Date : 11 April 2012
' Version : 1.0
' Copyright : GMARK Ltd. 2012
' ==================================================================

Dim Sld As PowerPoint.Slide
 Dim Shp As PowerPoint.Shape
 Dim CurrentSlide As Integer
 Dim PopupNameText

On Error Resume Next
 
 ' Change this string to match the name of popup objects in the presentation that must be
 ' matched for this rule. Note that the full name can be anything, as long as this string
 ' is contained within it eg. "APD Popup" or "APD Popup : Mega Trends" or "Mega Trends APD Popup"
 PopupNameText = "APD Popup"
 
 CurrentSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
 
 Set Sld = ActivePresentation.Slides(CurrentSlide)
 
 For Each Shp In Sld.Shapes
 If InStr(1, Shp.Name, PopupNameText) And Shp.Visible = True Then Shp.Visible = False
 Next
End Sub