Detecting Autosave from VBA 
Author Message
 Detecting Autosave from VBA

Is there a way to detect autosave vs user save (user clicking on
File/Save) from VBA?

 I am using the built in function App_DocumentBeforeSave (I have code
that does some checking before user saving).

However both the save and Autosave call this function. I cannot figure
out a way to detect whether the call was due  to a Save by the user or
Autosave.

I need to ignore the checking by Autosave...

TIA

Costas



Sun, 02 Nov 2003 06:02:23 GMT  
 Detecting Autosave from VBA
Hi Costas,

Quote:
> I am using the built in function App_DocumentBeforeSave (I have code
> that does some checking before user saving).

> However both the save and Autosave call this function. I cannot figure
> out a way to detect whether the call was due  to a Save by the user or
> Autosave.

In this case, I'd use procedures named FileSave and FileSaveAs to
intercept these built-in Word commands, instead of the event. These will
not react to the AutoSave.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)



Sun, 02 Nov 2003 19:25:03 GMT  
 Detecting Autosave from VBA
On Wed, 16 May 2001 13:25:03 +0200, Cindy Meister  -WordMVP-

Quote:

>Hi Costas,

>> I am using the built in function App_DocumentBeforeSave (I have code
>> that does some checking before user saving).

>> However both the save and Autosave call this function. I cannot figure
>> out a way to detect whether the call was due  to a Save by the user or
>> Autosave.

>In this case, I'd use procedures named FileSave and FileSaveAs to
>intercept these built-in Word commands, instead of the event. These will
>not react to the AutoSave.

Thank you so much. Was this always the case? Or is it just new with
Word 2000. Is there any docs about this anywhere? I can' find docs
about it.

Costas



Mon, 03 Nov 2003 23:26:17 GMT  
 Detecting Autosave from VBA
Quote:
> Thank you so much. Was this always the case? Or is it just new with
> Word 2000. Is there any docs about this anywhere?

This has been possible since Word 1.0, I think (although I only came
on board in 2.0). You can substitute your own code for any built-in
Word command simply by using the command as the name of your
procedure (Public Sub). One of the things that makes Word very
adaptable for the developer...

Probably the best documentation for this "older generation" stuff is
"Hacker's Guide to Word for Windows" and the Word95 Developer's Kit -
both of which deal with the old WordBasic language (here's where you
go for dialog box arguments, too). But since the "innards" of how
Word actually works haven't changed, a lot of the general information
is still very relevant.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)



Tue, 04 Nov 2003 21:29:22 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Autosave for VBA projects.

2. AutoSave causes MailItem.Save to Hang ???

3. Autosave attachments?

4. AutoSave Calendar as HTML

5. Recognise AutoSaves in DocumentBeforeSave

6. autosave attachments based on suffix

7. Lost my AutoSave Macro!!

8. Autosave using file name from a field in the document

9. Macro for Autosaving

10. Autosave macro

11. Autosave macro

12. An "Autosave" Sub

 

 
Powered by phpBB® Forum Software