Results 1 to 2 of 2

Thread: Hiding slides in powerpoint with a button click

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Hiding slides in powerpoint with a button click

    I am using a powerpoint as a set of flash cards. I have it set up so that I can randomly re-arrange the slides every time I open the powerpoint, here is what I would really like to do. In order to rule out the slides you have learned successfully, have a button (icon or whatever) that appears on every slide in the same fashion, that when you click on it it hides the current slide. This way if you get a slide correct, you click the button that says you got it correct, it is then hidden, so that when you go through the powerpoint a 2nd time only slides you got wrong will be shown. Anyone have an idea? Sounds simple enough, button click will simply say hide current slide. But also, need the button to appear on every slide.

  2. #2
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    14
    You can add button in every slide whenever you add a new slide as below:

    First open VBA editor and add Class Modules and Copy & Paste below code. This is a class module and contains event of powerpoint. It contains Newslideadd event which trigger always whenever a new slide will be added and create a shape in top right corner and assign a macro to the shape.

    Code:
    Option Explicit
    
    
    Public WithEvents PPTEvent As Application
    
    
    Private Sub PPTEvent_PresentationNewSlide(ByVal Sld As Slide)
    
    
        Dim shpAddNew       As Shape
        Dim dblWidth        As Double
        
        dblWidth = ActivePresentation.PageSetup.SlideWidth
        Set shpAddNew = Sld.Shapes.AddShape(msoShapeRectangle, dblWidth - 100, 10, 80, 20)
        With shpAddNew
            .TextEffect.Text = "Click Me"
            .TextEffect.FontSize = 12
            .ShapeStyle = 35
            With .ActionSettings(ppMouseClick)
                .Run = "SayHello"
                .Action = ppActionRunMacro
            End With
        End With
        shpAddNew.ActionSettings(ppMouseClick).Action = ppActionRunMacro
    
    
    End Sub
    Now add a module and add below code, save file and reopen it as auto open need to run to assigining event to powerpoint application otherwise NewSlideAdd event will not trigger.

    Code:
    Option Explicit
    
    
    Public cPPTObject As New cNewSlideClass
     
    Sub Auto_Open()
         'set a application reference to the event-enabled object
        Set cPPTObject.PPTEvent = Application
    End Sub
    
    
    Sub SayHello()
    
    
        MsgBox "Hello World"
    
    
    End Sub
    Last edited by LalitPandey87; 06-26-2014 at 01:54 PM.

Similar Threads

  1. Replies: 1
    Last Post: 07-10-2013, 11:38 AM
  2. Replies: 2
    Last Post: 07-06-2013, 05:59 PM
  3. Creating Powerpoint Slides: Rules
    By Transformer in forum Powerpoint Help
    Replies: 0
    Last Post: 05-17-2013, 08:41 PM
  4. Replies: 2
    Last Post: 04-14-2013, 08:23 PM
  5. Click Run cycle
    By PcMax in forum Excel Help
    Replies: 6
    Last Post: 11-01-2011, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •