PC Faris
2010-04-21 19:30:41 UTC
Based on:
http://word.mvps.org/FAQs/MacrosVBA/
I tried to create a class module for oApp to handle events.
I get the oApp dropdown with then populates the VB editor with a list of
events, but they don't work.
I did this in the document itself and not in a template; and I run the
startoApp() manually instead of AutoExic, but this shouldn't matter, right?
So why doesn't it work?
See code (which I used in the class module) below.
Thanks,
Phil
Option Explicit
Dim oAppClass As New ThisApplication
Public WithEvents oApp As Word.Application
Public Sub startoApp()
Set oAppClass.oApp = Word.Application
End Sub
Private Sub oApp_WindowBeforeDoubleClick(ByVal Sel As Selection, Cancel As
Boolean)
MsgBox "crick crick"
End Sub
http://word.mvps.org/FAQs/MacrosVBA/
I tried to create a class module for oApp to handle events.
I get the oApp dropdown with then populates the VB editor with a list of
events, but they don't work.
I did this in the document itself and not in a template; and I run the
startoApp() manually instead of AutoExic, but this shouldn't matter, right?
So why doesn't it work?
See code (which I used in the class module) below.
Thanks,
Phil
Option Explicit
Dim oAppClass As New ThisApplication
Public WithEvents oApp As Word.Application
Public Sub startoApp()
Set oAppClass.oApp = Word.Application
End Sub
Private Sub oApp_WindowBeforeDoubleClick(ByVal Sel As Selection, Cancel As
Boolean)
MsgBox "crick crick"
End Sub