Newbie - Trapping _QueryClose and/or _Terminate

A

amakeler

Subject: Newbie - Trapping _QueryClose and/or _Terminate

IN VBA (for Word)

Hi all,

Can somebody help with the following.

I have a form (dialog box) and I want to prevent the user fro
terminating
the form (eg by clicking the close X at the top-right corner) excep
when I
allow it.

I have written the following handlers, but they don't do the job:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode A
Integer)
If ProcessExitReq = 0 Then
Exit Sub
End If
End Sub

Private Sub UserForm_Terminate()
If ProcessExitReq = 0 Then
Exit Sub
End If
End Sub

What can I do to trap all the exit messages and prevent them (or th
exit
events) from running to completion and terminating the form?

Please reply to this forum and my home address:
(e-mail address removed)


tia

Avraha
 
P

Peter Hewett

Hi amakeler

I've answered this in: microsoft.public.word.word97vba

Where you question may apply to more that one News Group please cross post
you question. This minimises the duplication of effort in answering then

Cheers - Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top