disable that close button in the corner

Started by elistein, May 09, 2015, 11:07:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

elistein

Hi,

I know this question was raised in January 05, 2011, but without an answer.

So, how to disable that red X button in VISIO 2003?

Paul Herber

I don't think you can disable it, but you can trap the document close and application close events, you'll need VBA or an addon to be able to do this.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

elistein

#2
Hi Paul Herber

Thank you for your fast reply.

I found this code that's working fine, but its for a UserForm:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
     
    If CloseMode = 0 Then
        Cancel = True
        MsgBox "The X is disabled, please use a button on the form.", vbCritical
    End If
     
End Sub

Is it possible to adapt it for the drawing document.

Many Thanks


AndyW

You need to handle the QueryCancelDocumentClose event.
Live life with an open mind

elistein

Hi AndyW

Of course you are right.

Works well

Many Thanks