I'm using MS Interop to open a generated file for a user, allow them to edit it and then close it, after which I save it for them (it's part of a larger process). Since the user doesn't need to save the file manually I would like to cancel that pop up dialog to save the file when the user tries to close the document. The following doesn't seem to work for me in a handler for the DocumentBeforeClose event:
App.ActiveDocument.Saved = true;
This seems like it should mark the Word document as saved, but doesn't.
Anyone come across this issue?
-nomad311
I found out I was creating a chain of events by calling the SaveAs() method of the document from the DocumentBeforeClose event handler. But, I was canceling the save (intended to only stop a user save) in the DocumentBeforeSave event handler. Thus, canceling the chain ...which stops the close operation, but the 'save changes' pop-up still gets launched?!
...Thought I would spell this out in case someone else gets as cleaver as I did :)
-nomad311
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.