By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

FileSystemWatcher and Word file

P: n/a
I'm making an application that monitor a particular file (not a
directoy) and when trigger a change event it start a backup process of
the changed file. I'm using FileSystemWatcher component. My problem is
that i cannot start the backup process until the word file is closed.
I think this is caused because Word application saves changes in a
temporary file, and the changes are mapped to the REAL file only after
closing de Word application, can anybody confirm or refuse this??? Is
my only chance to wait until the MS Word app is closed??? and in that
case is there anyway to know when the application is closed beside and
infinite loop (or similar) asking if the file is open????

I will appreciate if anyone could help me!!!!!

Jan 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
the temp file will have a name like this:

~$_1974_07_19.doc

in the first 2 characters

The temp file will be removed when the actual file is closed

I'm making an application that monitor a particular file (not a
directoy) and when trigger a change event it start a backup process of
the changed file. I'm using FileSystemWatcher component. My problem
is
that i cannot start the backup process until the word file is closed.
I think this is caused because Word application saves changes in a
temporary file, and the changes are mapped to the REAL file only after
closing de Word application, can anybody confirm or refuse this??? Is
my only chance to wait until the MS Word app is closed??? and in that
case is there anyway to know when the application is closed beside and
infinite loop (or similar) asking if the file is open????
I will appreciate if anyone could help me!!!!!

Jan 23 '07 #2

P: n/a
piola,

when the file changes, start a new loop in which you try to open the file
exclusively for write. When that happens, it means that your file was
closed.

--
Regards,
Robson Siqueira
Enterprise Architect
"piola vago" <fr*************@gmail.comwrote in message
news:11*********************@a75g2000cwd.googlegro ups.com...
I'm making an application that monitor a particular file (not a
directoy) and when trigger a change event it start a backup process of
the changed file. I'm using FileSystemWatcher component. My problem is
that i cannot start the backup process until the word file is closed.
I think this is caused because Word application saves changes in a
temporary file, and the changes are mapped to the REAL file only after
closing de Word application, can anybody confirm or refuse this??? Is
my only chance to wait until the MS Word app is closed??? and in that
case is there anyway to know when the application is closed beside and
infinite loop (or similar) asking if the file is open????

I will appreciate if anyone could help me!!!!!

Jan 24 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.