Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public WithEvents appWord as Word.Application
- Private Sub appWord_DocumentBeforeSave _
- (ByVal Doc As Document, _
- SaveAsUI As Boolean, _
- Cancel As Boolean)
- Dim intResponse As Integer
- intResponse = MsgBox("Do you really want to " _
- & "save the document?", _
- vbYesNo)
- If intResponse = vbNo Then Cancel = True
- End Sub
- Public WithEvents App As Word.Application
- Private Sub App_DocumentBeforeSave _
- (ByVal Doc As Document, _
- SaveAsUI As Boolean, _
- Cancel As Boolean)
- Dim intResponse As Integer
- intResponse = MsgBox("Do you really want to " _
- & "save the document?", _
- vbYesNo)
- If intResponse = vbNo Then Cancel = True
- End Sub
- Dim X As New EventClassModule
- Sub Register_Event_Handler()
- Set X.App = Word.Application
- End Sub
- Private Sub Document_New()
- Register_Event_Handler
- End Sub
- Private Sub Document_Open()
- Register_Event_Handler
- End Sub
- Set X.App = Word.Application
- Set X.appWord = Word.Application
Add Comment
Please, Sign In to add comment