RickSprague
08-23-2010, 04:54 AM
I have a problem. I have two documents, Doc1 and Doc2. Doc2 has a Class Module with the following code:
Option Explicit
Public WithEvents App As Word.Application
Private Sub App_DocumentBeforeClose(ByVal Doc As Document, Cancel As Boolean)
Dim strInput As String
If ActiveDocument.ReadOnly Then Exit Sub
frmInputBox.Show
End Sub
I need to open Doc1, run some code that includes opening Doc2. Doc1 then saves Doc2 and closes it. But, of course, when Doc2 closes the form frmInputBox opens. I need to close Doc2 with firing the BeforeClose event.
Any help very much appreciated.
Option Explicit
Public WithEvents App As Word.Application
Private Sub App_DocumentBeforeClose(ByVal Doc As Document, Cancel As Boolean)
Dim strInput As String
If ActiveDocument.ReadOnly Then Exit Sub
frmInputBox.Show
End Sub
I need to open Doc1, run some code that includes opening Doc2. Doc1 then saves Doc2 and closes it. But, of course, when Doc2 closes the form frmInputBox opens. I need to close Doc2 with firing the BeforeClose event.
Any help very much appreciated.