View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default Make a Word event macro fire in active document

Hi
This is a cross post originally to a Word programming group.
Unfortunately, you can practically see the tumbleweed blowing down the
main street of the Word groups...

If anyone in here could answer this I'd be most grateful:
I have an application level event macro (in class module) that creates
a popup menu

Public WithEvents WordApp As Word.Application
Private Sub WordApp_WindowBeforeRightClick(ByVal Sel As Selection,
Cancel As Boolean)
Make_FreePopUp
Cancel = True
End Sub

The document_open event macro in ThisDocument is

Private Sub Document_Open()
Set wdApplication.WordApp = Word.Application
End Sub

and in a general module I have

Public wdApplication As New Class1
Public Sub Make_FreePopUp()
'etc
End Sub

This works fine in its template document tester.dot. It also works fine

in the active document if tester.dot is open.
i've followed two suggestions as to how to make this available to the
active document without tester.dot being visible.
Try 1: put the template file in the startup folder
Try 2: go to Tools, templates and AddIns.. and add it to the Global
templates and AddIns list

Neither option fires the macro in the active document.
I don't want to change normal.dot as this will disable the normal right

click menu.

I'm completely new to word macros but know Excel VBA pretty well, where

i can simply put Is AddIn = True on the file and add it to the users
AddIn list. What is the equivalent process in Word??

Again, apologies for the cross post but this apparently simple issue is
driving me nuts.

regards
Paul