erin.sebastian@cowaninsurancegroup.com was telling us:
erin.sebastian@cowaninsurancegroup.com nous racontait que :
> Hi All
> I found a way to do it, via the Microsoft Word MVP site (which is a
[quoted text clipped - 3 lines]
> which will intercept the closing of the form and cancel it all
> together.
Make sure you tell the user what is going on, I would hate to click on the
X, expect the form to close, but instead, nothing happens, click again,
nothing again...
For example:
If CloseMode = vbFormControlMenu Then
MsgBox "You cant quit like that!"
Cancel = True
End If
Or tell them to use your own buttons instead.
Personally, I prefer to disable it, so visually, the user knows the X is not
functional.
See:
http://word.mvps.org/FAQs/Userforms/DisableClose.htm

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
> I found a way to do it, via the Microsoft Word MVP site (which is a
> great reference tool - http://word.mvps.org/FAQs/MacrosVBA/index.htm)
> In the queryClose event of the userform you can put this code
> If CloseMode = vbFormControlMenu Then Cancel = True
> which will intercept the closing of the form and cancel it all
> together.
That's a *great* technique. That is, *IF* you treat the [X] identical to
the "Cancel" button. No Cancel button? Disable instead.

Signature
Working without a .NET?
http://classicvb.org/
erin.sebastian@cowaninsurancegroup.com - 10 Feb 2006 18:54 GMT
thank you very much!!! i've disabled the close button!