Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Word 2007 but I've noticed this with earlier versions as well.

It appears that when I open and work on a document in word, the system creates a hidden file with a weird file name residing in the same folder. This is probably what allows me to auto-recover the file after a crash.

Unfortunately, when I hit save, it appears the system deletes the original file and renames the hidden file. This is a big problem for me because I'm often editing a file that is under source control (the documentation for my employer's product) and when that happens Visual Studio / Team Foundation Server assumes the file has been deleted and it vanishes from the product and from source control.

Any way to get this functionality to go away?

share|improve this question
This is going to sound like a dumb question, but why are Word docs in the source control repository instead of a TFS/Sharepoint team site "shared documents" library? In the latter I think you wouldn't have to worry about this sort of thing. – John Rudy Oct 26 '09 at 21:15
I see what you mean, but this is product documentation - administrator and user manuals, for instance. It is developed and versioned with the product, so when I get version 2.0.177 of my solution it includes the manuals for that version. – Barry Fandango Oct 27 '09 at 19:52

It appears to me that you are trying to move the mountain to Mahomet. Step back and think about how revision control usually works (think about check-ins and check-outs a la CVS or SVN).

Instead of working on the files live in the source control repository, you should probably:

  • check out the file you intent to make changes to
  • make your updates on your local copy of the file
  • check in the new version of the file you updated

This seems to make so much more sense than what you are trying to do by changing how MS Word works.

share|improve this answer
Actually that's what I'm doing. I get the latest version of the document and check it out, then work on it in MS word. When I hit the save button, the delete/rename operation seems to trigger some magic inside of TFS and it disappears from the project. – Barry Fandango Oct 27 '09 at 19:50
And i really do want to change how Word works. Using a hidden file and deleting/renaming on save is just bad behaviour. Any software (including Visual Studio in this case) that reacts when a file gets deleted is going to get fooled whenever a user saves a file from Word. I've always considered it a hacky implementation and I would love to be able to change how it works. – Barry Fandango Oct 27 '09 at 20:03

Have you tried going to Word Options/Save and unchecking Save Autorecover information every [option] seconds?

I've no experience with dedicated source control, so I don't know if that'll do, but it looks promising.

share|improve this answer
Hey Phoshi, changing that option, along with Advanced > Save > Allow Background Saves, didn't change the behaviour unfortunately. – Barry Fandango Oct 27 '09 at 19:59
Dang. I guess it's pretty hard-coded, then :( – Phoshi Oct 27 '09 at 23:22

It's hard coded for good reason - if you have an open handle on the actual file and then attempt to save, overwriting that file, then the save fails for some reason (especially on a network fileshare, but even just local issues like power failure), you would now have half a file which is useless. The method Word uses here when saving is to save a temporary file, make sure it saved properly then delete the original and 'swap in' the temporary file, all transparently to the user of course.

The "oddly named" files you see are meta files which enable users to get helpful locking messages - "the document you want is being edited by Barry" - the user name is fetched from that temp file (which is why it shows the user's name as stored in Office, not their login account name).

AutoRecover files are not stored in the same folder as the actual document, but in a user-profiled local folder.

share|improve this answer
Thanks for the clarification, that's good to know! – Barry Fandango Nov 3 '09 at 15:52
up vote 1 down vote accepted
  1. This is not an option in Microsoft Word - you're stuck with the existing saving/deleting/replacing functionality.

  2. Visual Studio notices when a file gets deleted from disk, and automatically removes it from the project. Deactivating the option "Detect when file is changed outside the environment" in the Tools > Options > Documents menu does not turn off this behaviour.

  3. You can work around this (inconveniently) by doing the following:

    • Check out the DOC/DOCX file in your source control system.
    • Exit Visual Studio, or just close the Solution.
    • Do work on the file in Word, doing a final Save whenever you're done.
    • Open the solution back up and your file will still be included in the project.
    • Check the file back in.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .