Consulting

Results 1 to 2 of 2

Thread: Shape ppt event handler

  1. #1

    Shape ppt event handler

    hello everyone ,

    I would like to create an event handler in such a way that when i double click a shape on a slide , a messagebox is fired and give me the name of that shape.
    I have created a class called cEventClass with this private sub
    [VBA]
    Private Sub application_WindowBeforeDoubleClick(ByVal Sel As Selection, ByVal Cancel As Boolean)

    MsgBox Sel.ShapeRange.Name
    End Sub
    [/VBA]
    and the following module to launch the event handling
    [VBA]
    Dim cPPTObject As New cEventClass


    Sub TrapEvents()

    Set cPPTObject.PPTEvent = Application

    End Sub
    [/VBA]
    The problem i have is that it doesn't give me the name of the shape once i double click it , what sould i do?
    Thank you

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    The code is good but yuo haven't understoond the event.

    BeforeDouble Click fires before the event that would normally happen on double click.

    Two problems the event fires with a WINDOW click (not a shape)

    Problem2 is nothing normally happens to a slide on double click so the before event doesn't fire, there's nothing to be before. If you double clicked in slide sorter view for example the event would fire. (Your code would error though)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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