Working with word macros

P

Petricia Smith

hi,
1) A class module is created to capture events
2) This Application event: App_WindowBeforeRightClick is also marked
with a break point.
i.e. for the following code break point is kept and a function call is
made inside this.
Private Sub App_WindowBeforeRightClick(ByVal Sel As Selection, Cancel
As
Boolean)
End Sub

But then during application execution it never stops at the break
point.
Please help us in resolving this problem.
 
O

Ol

Petricia Smith said:
hi,
1) A class module is created to capture events
2) This Application event: App_WindowBeforeRightClick is also marked
with a break point.
i.e. for the following code break point is kept and a function call is
made inside this.
Private Sub App_WindowBeforeRightClick(ByVal Sel As Selection, Cancel
As
Boolean)
End Sub

But then during application execution it never stops at the break
point.
Please help us in resolving this problem.

Make sure that you've implimented following routines:

In "ThisDocument" module:
Private Sub Document_Open()
InitMyObjectInstance
.........
.........
End Sub

Private Sub Document_New()
InitMyObjectInstance
.........
.........
End Sub

The first 2 strings of your "module1" has to be like this:
Option Explicit
Public MyObjectInstance As MyClassModule

Somethere in your "module1":
Sub InitMyObjectInstance
Set MyObjectInstance = New MyClassModule
End Sub

The first 2 strings of your "MyClassModule" has to be like this:
Option Explicit
Public WithEvents App As Word.Application
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top