-
Use DocClose.
[vba]
Sub DocClose()
Dim response
response = MsgBox("Yes or no", vbYesNo)
If response = vbYes Then
ActiveDocument.Close
Else
MsgBox "Sorry...I am not going to close the document."
Exit Sub
End If
End Sub
[/vba]Neither File > Close, OR the "X" Close button, will close the document unless you click "Yes."
Please use the underscore character when posting code. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules