Reputation: 479
I Opened/Created a new Word document dynamically on FormLoad using:
I have "SAVE BUTTON" that saves the said document using:
Then I added the syntax for closing the document on FormClosed using:
Scenario: I Ran my program and closed/exit after. Suddenly a "Save as" dialog for the document popped up. I realized that I haven't saved the document because the saving process is in the "SAVE BUTTON".
How can I scape saving the document or automatically choose "cancel" for saving? Any help folks?
Upvotes: 0
Views: 1362
Reputation: 399
Set the property oDoc.Saved to true. Then Word will not prompt to save when the document is closed
Upvotes: 0
Reputation: 3302
The Close method includes a parameter for whether changes should be saved. Just pass wdDoNotSaveChanges as the first parameter. See the documentation for the Close method for details.
Upvotes: 6