Results 1 to 1 of 1
2001-01-07, 01:21 #1
- Join Date
- Dec 2000
- Queanbeyan, New South Wales, Australia
- Thanked 0 Times in 0 Posts
DocumentChange event in Word 2000
Has anybody had experience in using the DocumentChange event? I'm having a problem in getting it working in Word 2000.
I used code from the MVPS site (www.mvps.org) as a guide- I've stripped it back as far as I can to reproduce the problem.
I have an add-in in the Word startup directory. I have a DocumentChange event which is working well until I run a macro- and then it stops working.
This is the code I have in the add-in:
in form "Userform1" (a completely blank form):
Private Sub UserForm_Initialize()
in module "main":
Dim oAppClass As New ThisApplication
Public Sub AutoExec()
Set oAppClass.oApp = Word.Application
in module "ShowForms":
Public Sub ShowForms()
In class module "ThisApplication":
Public WithEvents oApp As Word.Application
Private Sub oApp_DocumentChange()
When I start up Word, I get the message "DocumentChange" as I would expect. I get it every time I create a new document, swap focus, or close a document, I get the message, again as I would expect.
However, If I run "ShowForms" from the macro menu, the message does not get displayed until after I close down Word and reopen it.
The same code works OK in Word 97.Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.