Word AfterSave event?

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

Word AfterSave event?
Is there an After Save event in Word? 
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hi all,

We've got the following:

=====
...maybe it will save time to other developers.

Code:
Private Sub th_AfterSave() 
        'Check to see if there are any documents in the queue. If not, 
        'save the headache and just keep checking. 
        If Me.queue_Docs.Count > 0 Then 
            'SyncLock the queue object to prevent thread collision. 
            SyncLock Me.queue_Docs
....


It should be probably reordered:

Private Sub th_AfterSave() 
        'SyncLock the queue object to prevent thread collision. 
         SyncLock Me.queue_Docs 

           'Check to see if there are any documents in the queue. If not, 
           'save the headache and just keep checking. 
            If Me.queue_Docs.Count > 0 Then ....


Otherwise queue_Docs could be modified between check for Count and following Peek, which causes exception on my PC.

Best Regards,

Juraj Hájek
=====

Thank you, Juraj!

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Jan, 2010 10:11:51 Top
Bojan Brankov




Posts: 1
Joined: 2010-02-01
Hello everybody,

This code works in MS Word 2007, but unfortunately after save event is not triggered when document is saved while closing, using save document dialog. It works only when it is saved explicitly (File -> Save or button Save).

Do you have any idea how to trigger after save event when document is closing?

Thanks for your help.

______________
Bojan Franzee Brankov
Posted 01 Feb, 2010 08:43:05 Top
Andrei Smolin


Add-in Express team


Posts: 14140
Joined: 2006-05-11
Hello Bojan,

I'm sorry, we don't have a solution for this issue.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Feb, 2010 02:22:41 Top