Agile Tortoise

Greg Pierce’s blog

« Microsoft makes thing simple      OpenXml, back to reality »

System.IO.FileSystemWatcher and Word 2007

Development can be great fun. Can be. Right at the moment, I feel like I’m beating my head against a wall. I’ve put together a nice little app to monitor a directory for file changes using .NET’s System.IO.FileSystemWatcher.

Works great, mostly. I’ve been testing all along using “touch” at the command line to trigger updates to files, and the FileSystemWatcher events trigger just as they should. I can open files in the directory in a text editor, call “save” on them, and the events fire just fine. But, if I open a file in Word 2007 (which is the host app for the OpenXML documents I actually need to monitor), altered them and “save”, the events aren’t fired. The file is saved. It’s attributes are updated. But the FileSystemWatcher never hears about it. Gack. Soooo annoying.

Share/Save/Bookmark

Monday, November 6th, 2006 at 3:59 pm and is filed under .NET, OpenXML. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “System.IO.FileSystemWatcher and Word 2007”

  1. Agile Tortoise » Word 2007 - System.IO.FileSystemWatcher followup Says:
    November 9th, 2006 at 5:09 pm

    [...] Ok, just to followup, I figured out the deal with Word and FileSystemWatcher that I posted about the other day. Don’t know why this wasn’t obvious to me, but Word, rather than saving a file like 99.9% percent of the applications on the planet do, instead works on a hidden temp file, saves it, then renames it to replace the original. [...]

Leave a Reply