Differentiate between Save And AutoSave

  • Thread starter Thread starter Dhananjay
  • Start date Start date
D

Dhananjay

Hi All,
I am developing word addin using VSTO / vb 2005 / Office 2007.
Actually I need Word's DocumentAfterSave event, which unfortunately
not supported in Word Object Model.
So I trapped DocumentBeforeSave event of Application object for that
purpose. But unfortunately, Save button's event OR Word's AutoSave
event calls same DocumentBeforeSave event. So I need to differentiate
between these 2 calls. How I can check whether the call to
DocumentBeforeSave is coming from Save Button's click event or it is
coming from AutoSave internally?

Thanks in advance,
Dhananjay
 
Dhananjay was telling us:
Dhananjay nous racontait que :
Hi All,
I am developing word addin using VSTO / vb 2005 / Office 2007.
Actually I need Word's DocumentAfterSave event, which unfortunately
not supported in Word Object Model.
So I trapped DocumentBeforeSave event of Application object for that
purpose. But unfortunately, Save button's event OR Word's AutoSave
event calls same DocumentBeforeSave event. So I need to differentiate
between these 2 calls. How I can check whether the call to
DocumentBeforeSave is coming from Save Button's click event or it is
coming from AutoSave internally?


What do you mean exactly by "AutoSave?

Meanwhile, you can use the following subs:

Sub FileSave()

and

Sub FileSaveAs

They get invoked when the user does CTRL-S or does File > Save / File > Save
As

Those do not get invoked when, for instance, you close Word and Word asks if
you want to save the file. If this is what you mean by AutoSave, then you
can now tell when the save is initiated by Word or by the user.
 
Suzanne S. Barnhill was telling us:
Suzanne S. Barnhill nous racontait que :
He may mean the AutoRecovery save.

I doubt it because that setting does not actually save the document...
However it is possible that the DocumentBeforeSave event is triggered by the
AutoRecovery feature... I have not used that event in a while...

But he may be confused... Sometimes it hard to tell what is going based on
the limited descriptions we get...
 
Back
Top