Ytr
11-10-2009, 08:17 AM
I found this code on the internet:
Sub FileClose()
NewCloseDialog
End Sub
Sub DocClose()
NewCloseDialog
End Sub
Sub NewCloseDialog()
On Error GoTo Error
If ActiveDocument.Saved = False Then
SureCloseDialog.Show
Else:
ActiveDocument.Close
End If
Exit Sub
Error:
MsgBox ("Something went wrong.")
End Sub
This is really handy. But it only works when you click on: Office-Button>Close. How can I add a function to it that it always happens when you try to close the file????
P.S. I am a noob, so I need well explanation... Not: Oh, you need to add an close.Dialog If function on the third acudelir..:bug:
Sub FileClose()
NewCloseDialog
End Sub
Sub DocClose()
NewCloseDialog
End Sub
Sub NewCloseDialog()
On Error GoTo Error
If ActiveDocument.Saved = False Then
SureCloseDialog.Show
Else:
ActiveDocument.Close
End If
Exit Sub
Error:
MsgBox ("Something went wrong.")
End Sub
This is really handy. But it only works when you click on: Office-Button>Close. How can I add a function to it that it always happens when you try to close the file????
P.S. I am a noob, so I need well explanation... Not: Oh, you need to add an close.Dialog If function on the third acudelir..:bug: