dophu

Hello,

After installing of my word add-in, I keep receiving the message: "Saving AutoRecovery File is Postponed for <filename>". From this KB article, it looks like there is a problem with the permission:

http://support.microsoft.com/kb/174162/EN-US/

I tried to change the .NET security policy for my DLL's but it does not help. Any suggestion would be appreciated.

Phuoc


Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

Cindy Meister

This article specifically discusses Word 97 and Windows NT 4, and that the problem has been rectified in the SP2.

Which version of Word are you targeting / in which version of Word are you seeing this message

The permissions discussed in this article are not those for the .NET Framework, but for Word being able to generate and save a file name (for the automatic backup) in a - supposedly - network location..






Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

dophu

I discovered why this dialog is popped up in my add-in. It turns out because I changed some default behavior of Word's BeforeSave events and canceled saving of certain files, the AutoRecovery file is being canceled as well. That's why this dialog is prompted.

Thanks,
Phuoc




Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

ronald75

Hi,

I am also using the BeforeSave event of Word, can you tell me how you prevent the autorecovery files from being saved

I'm trying to determine whether the BeforeSave event is triggered by an autorecovery save or by a normal document save.

Ronald





Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

Cindy Meister

ronald75 wrote:

I am also using the BeforeSave event of Word, can you tell me how you prevent the autorecovery files from being saved

I'm trying to determine whether the BeforeSave event is triggered by an autorecovery save or by a normal document save.

In most versions of Word (you unfortunately don't specify which one you're using) Auto Recovery (or AutoSave) is controlled through the Options. It's questionable, however, whether you should turn this off...

There is no way to distinguish directly whether AutoRecovery triggered the save. Depending on the version of Word involved you can discover whether the user triggered the save. See for example this discussion

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2298918&SiteID=1






Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

ronald75

Cindy,

I am using Word 2003 and WithEvents in an VBA add-in (DOTfile)

Your link does not clarify things, there's nothing there about user-triggered events

I need to trap the DocumentBeforeSave event, because in specific cases I need to save the document in a special way (Hummingbird DM related). This works fine most of the time, but not when an Autorecovery Save is triggered. The document that is passed to DocumentBeforeSave is the current document, my functions run ok, but then after the Event, Word crashes. When a user normally presses on Save, this does not happen and all is fine, so my function should not be the problem.

If I can distinguish between Autorecovery Save and 'normal' save, maybe I can fix this.

Ronald





Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

Cindy Meister

ronald75 wrote:

I am using Word 2003 and WithEvents in an VBA add-in (DOTfile)

Your link does not clarify things, there's nothing there about user-triggered events

I need to trap the DocumentBeforeSave event, because in specific cases I need to save the document in a special way (Hummingbird DM related). This works fine most of the time, but not when an Autorecovery Save is triggered. The document that is passed to DocumentBeforeSave is the current document, my functions run ok, but then after the Event, Word crashes. When a user normally presses on Save, this does not happen and all is fine, so my function should not be the problem.

If I can distinguish between Autorecovery Save and 'normal' save, maybe I can fix this.

Hi Ronald

Ah, you see how important it is to provide this information :-) For questions concerning VBA, you do need to ask in the newsgroups. The forum is about VSTO, a .NET developer substitute for VBA. I can give you an idea or two how to approach the problem, but for follow-up, please ask in the following newsgroup:

http://www.microsoft.com/office/community/en-us/default.mspx dg=microsoft.public.word.vba.general&lang=en&cr=US

As long as you're using VBA code, in a document or template, you can "trap" Word's internal commands. All you need to do is name a public Sub procedure with the name of the internal command. So

Sub FileSave()

End Sub

and

Sub FileSaveAs()

End Sub

will be executed when the user tries to save the document. You just put the that should run in these procedures. Neither of them will fire when AutoSave executes, BTW.






Re: Visual Studio Tools for Office Word add-in: Saving AutoRecovery File is Postponed

ronald75

Cindy,

Yep, it is important i see. Didn't even notice where I was, you just Google and are happy that you found something that connects with 'your' problem.

I know the VBA subs already, cannot use them however, for several reasons.

Thanks for your answers,

Ronald