![]() |
#2
|
|||
|
|||
![]()
You are going to need to create a template addin containing an event handler.
'Put this code in a standard code module: Public AppEvents As New clsEvents Public Sub AutoExec() Set AppEvents.WordApp = Word.Application End Sub 'Put this code in a class module named clsEvents: Public WithEvents WordApp As Word.Application Private Sub WordApp_DocumentOpen(ByVal strDocName As Word.Document) MsgBox strDocName & " is opening" End Sub Private Sub WordApp_DocumentBeforeClose(ByVal strDocName As Word.Document, ByRef Cancel As Boolean) MsgBox strDocName & " is closing" End Sub Private Sub WordApp_Quit() MsgBox "WordApp_Quit" End Sub You can probably put your code in the DocumentBeforeClose event. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
oao | Word | 5 | 07-27-2015 11:55 PM |
word 2003 slow saving passworded files windows 7 | dontdoslow | Word | 5 | 08-08-2014 04:12 AM |
![]() |
Gillian0511 | Word | 4 | 07-31-2014 03:29 AM |
Excel 2003 / 2007 files saving slow on Win 2003 Server | Atradius | Office | 0 | 07-23-2011 07:41 AM |
Can you embed a project 2000 doc into a Word 2003 doc? | jackdeth | Office | 0 | 11-14-2006 01:02 PM |