G
Greg Maxey
Word 2007
I don't know the constant name for the dialog that displays when you click
on the right hand "X" to close a document, but I can make it appear with:
Sub Testing()
Dialogs(98).Show
End Sub
What I can't figure out, is why it causes a RunTime Error 4198 "Command
Failed" if I click "Cancel" or the "X" in the dialog.
Second issue
I am trying to intercept the FileSave and FileSaveAs commands and perform an
action on save. I have that part figured out, but I need to sort out how to
make it work if the user clicks the "X" or the "Close" command on the Office
Menu. I have put code in the Document_Close Event and I only want a part of
it to execute if the user choose to Save the file and not execute if they
canceled out of the dialog, close the dialog with the "X" or select not to
save the file.
It seems like the Document_Close event is fired before that dialog appears.
I can't figure out how to determine what the User does in that dialog:
What doesn't work and I think I kno why is something like:
Private Sub Document_Close()
If Dialogs(98).Show = -1 Then
'Call a procedure"
Else
'Do nothing
End If
End Sub
Help, Help, Help!
I don't know the constant name for the dialog that displays when you click
on the right hand "X" to close a document, but I can make it appear with:
Sub Testing()
Dialogs(98).Show
End Sub
What I can't figure out, is why it causes a RunTime Error 4198 "Command
Failed" if I click "Cancel" or the "X" in the dialog.
Second issue
I am trying to intercept the FileSave and FileSaveAs commands and perform an
action on save. I have that part figured out, but I need to sort out how to
make it work if the user clicks the "X" or the "Close" command on the Office
Menu. I have put code in the Document_Close Event and I only want a part of
it to execute if the user choose to Save the file and not execute if they
canceled out of the dialog, close the dialog with the "X" or select not to
save the file.
It seems like the Document_Close event is fired before that dialog appears.
I can't figure out how to determine what the User does in that dialog:
What doesn't work and I think I kno why is something like:
Private Sub Document_Close()
If Dialogs(98).Show = -1 Then
'Call a procedure"
Else
'Do nothing
End If
End Sub
Help, Help, Help!