Reputation: 720
I'm currently working on an add-in for word 2k3/2k7. I am currently limiting access to documents for users that do not use my add-in. So basically I decrypt the file using my add-in when the doc is opened and encrypt it on document close. The problem I have now is that word has this auto recovery thing which will save temporary files unencrypted and so if word crashes the users will have access to the doc even if they dont use the add-in.
So my question is, is there a way to programmatically disable auto recovery in word? If not, could anyone suggest another solution for this problem?
Upvotes: 1
Views: 2020
Reputation: 1
public void getstyle(Word.Document doc)
{
if (doc.Application.Options.SaveInterval==10)
{
doc.Application.Options.SaveInterval = 0;
}
}
Upvotes: 0
Reputation: 7562
I'm not 100% sure it would work, but you can try this:
Sub DisableAutoRecover()
Options.SaveInterval = 0
End Sub
Note: I wrote a VBA example as I didn't work with C# and Word so far. It shouldn't be difficult to "port" it, though.
Upvotes: 1