![]() |
|
#1
|
|||
|
|||
|
Is there a way to remove the Cancel button when the user clicks the "X" button in the upper-right corner of the Word window
I wrote the following but it didnt seem to work Code:
Private Sub Document_BeforeClose(Cancel As Boolean)
If ActiveDocument.Saved = False Then
Select Case MsgBox("Do you want to save changes to this document?", vbYesNo + vbExclamation + vbDefaultButton1, "Microsoft Word")
Case vbYes
ActiveDocument.Save
Case vbNo
'Do nothing
End Select
End If
End Sub
Pl assist. Thanks. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to cancel the function of auto indentation?
|
Msxfc | Word | 3 | 02-26-2022 07:24 AM |
| Outlook local fodlers: function and how to remove | village | Outlook | 0 | 04-14-2019 01:02 AM |
Remove Empty Line while using If MergeField Function
|
stevenel | Mail Merge | 19 | 07-13-2018 06:48 AM |
Restrict Editing function disable insert textbox function
|
IanM_01 | Word | 5 | 11-21-2015 02:29 AM |
#REF! Error in calling VBA function disappears when function is copied
|
lcaretto | Excel Programming | 2 | 05-26-2014 07:19 PM |