By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

problem with word eventsinking

P: n/a

I can't seem to get the word events to fire off in my clsWord object....i've
done this before a few years ago so I know it works.

I've reviewed via google for a couple hours and have not come up with a
solution...None of the events fire ........very frustrating.

Any help appreciated...

----------------------------------------------------------
module that instantiates the clsWord:
======================================
Private Sub openWord(as_ As String)
Dim objWordDoc As clsWord

Set objWordDoc = New clsWord
objWordDoc.wordDoc = as_

End Sub
my entire clsWord:
=======================================
Option Compare Database
Option Explicit

Private WithEvents mObjWord As Word.Application
Private objDoc As Word.Document
Private mbVisible As Boolean

Public Property Let wordDoc(as_ As String)
Set objDoc = mObjWord.Documents.Open(as_)
mObjWord.visible = True
End Property

Private Sub Class_Initialize()
Set mObjWord = New Word.Application
End Sub

Public Sub mObjWord_DocumentBeforeClose(ByVal Doc As Word.Document, Cancel
As Boolean)
Stop
End Sub

Private Sub mobjDoc_Close()
MsgBox "Document closed"
End Sub

Private Sub mobjDoc_DocumentBeforeSave(ByVal Doc As Word.Document, SaveAsUI
As Boolean, Cancel As Boolean)
MsgBox "before save"
End Sub

Public Sub mObjWord_Quit()
MsgBox "word quit"
End Sub

=======================================
Aug 14 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.