-
I want to close a word doc or exit word in the normal way
and NOT receive the 'do you want to save' prompt
I know about 'wdDoNotSaveChanges', which I would like to
use, but it won't work in 'Document.Close' or
'AutoClose'
This will work from a command button, but I want it to
work from 'X' or 'File' - 'Close'
Thanks in advance
-
what about trying application.quit.
Not so sure what you trying to do but what about just savinbg the doc just before you close it. do the save and then closew word.
also sometimes using sendkeys altf F$ = %{F4} is more stable
-
if it works from a command button then just use the code from the button in the Querry Unload and Unload events of the form.
The application quit using unsave should work. Try creating a macro to do what you want and then copy the macro code.
-
From Word start up the Visual Basic Editor and in the project window choose "This Document" and add the following code to the Close event:
Code:
Private Sub Document_Close()
ActiveWindow.Close wdDoNotSaveChanges
End Sub
Good luck!