PDA

View Full Version : Shape ppt event handler



saadamiens
01-27-2012, 02:09 AM
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

Private Sub application_WindowBeforeDoubleClick(ByVal Sel As Selection, ByVal Cancel As Boolean)

MsgBox Sel.ShapeRange.Name
End Sub

and the following module to launch the event handling

Dim cPPTObject As New cEventClass


Sub TrapEvents()

Set cPPTObject.PPTEvent = Application

End Sub

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

John Wilson
01-27-2012, 07:05 AM
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)