0
votes

I want to determine in Word (Office 365) if user enables AutoSave option. The purpose of it is to check this option in DocumentBeforeSaveEvent and prevent some actions on auto save enabled. I do this check such way:

Globals.ThisAddIn.Application.ActiveDocument.IsInAutosave

And according to Microsoft documentation this flag should be true in case user enabled autosaving. But it always false. No matter if I open document with already enabled autosave or create new document and save it by switching to autosave=on.

Are there reasons of why IsInAutoSave property does not work? Is there workaround to check if autosave enabled or not? Maybe this settings stored in other object, settings file or registry? Thanks in advance.

Auto save

1

1 Answers

2
votes

That property is not what you think it is. See Word 2013: AutoSave and the new property IsInAutoSave. It's supposed to be used during the DocumentBeforeSave event to tell if the current save is an autosave. It also says that in the documentation you linked.

I don't know what the correct property is though, for what you want.

Somewhat interestingly (and I'm on a tangent here), that property is not listed in intellisense for me when targeting 2013. I'm not sure why that is. I use this instead (it was needed for Word 2010):

dynamic wb = Application.WordBasic;
autosave = wb.IsAutosaveEvent == 1;

I don't recall where it came from.