Glen
Guest
|
objWordApp_DocumentBeforeClose(ByVal Doc As Word.Document, ByRef Cancel As Boolean) Handles objWordApp.DocumentBeforeClose
When the above method is called (via word's document close or app close event)it doesn't matter whether the variable "Cancel" is true or false the document still closes. I am trying to cancel the close event so the document/app doesn't close.
Any help? |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Glen.
Why don't you use the ADXWordAppEvents component? See the code below. It works fine.
Private Sub adxWordEvents_DocumentBeforeClose(ByVal sender As Object, ByVal e As AddinExpress.MSO.ADXHostBeforeActionEventArgs) Handles adxWordEvents.DocumentBeforeClose
If MessageBox.Show("Close???", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) = DialogResult.Cancel Then
e.Cancel = True
End If
End Sub
|
|