Word Document Close Event

Add-in Express™ Support Service
That's what is more important than anything else

Word Document Close Event
Word Document Close Event 
Sune Keller




Posts: 2
Joined: 2008-09-18
Hi,

How do I trap a Word document close event using Add-in Express ? I would like to import the saved document into a database, but the DocumentBeforeSave event can't be used, because the document is not saved at this time... (and may never be saved i the user clicks "No").

Kind Regards
Sune
Posted 18 Sep, 2008 05:59:51 Top
Eugene Astafiev


Guest


Hi Sune,

You can use the DocumentBeforeClose event of AddinExpress.MSO.ADXWordAppEvents class.

Posted 18 Sep, 2008 08:32:39 Top
Sune Keller




Posts: 2
Joined: 2008-09-18
Hi Eugene

The DocumentBeforeClose event is fired before the "Save" event. Futher more, if the user hits the save button (not closing the document) then DocumentBeforeClose is not fired.

I have come up with solution where I in the DocumentBeforeSave event saves the document, write it to the database at set "Cancel" to true. But is this the best way? I'm missing a DocumentAfterSave event :D

/Sune
Posted 18 Sep, 2008 09:02:05 Top
Eugene Astafiev


Guest


Hi Sune,

Unfortunately there is no such event in the Word Object Model.
Posted 18 Sep, 2008 09:13:55 Top