Can you trick Word into thinking a file is locked by another user?

B

barkertj

I'm working on a document-management project at my company.

as you know, when you open a file that is on a network drive, office
apps will say 'file X is being modified by <Person> do you want to
open in read-only mode'. I want to see if I can emulate this behaviour
programatically to lock documents

I've read that office apps use a ~$XXX.tmp as a lock-file.
So, to test, i created a document, made edits and then copied the .doc
and .tmp to another directory

I thought that if i then went to view the file (with it's .tmp file
still there) that it would tell me it was locked. But alas no.

I also sent these files to someone else to see if it would say I had
it locked but Word ignored that too.

If anyone has any creative ideas in this area let me know!
 
G

Guest

Surely to do this you dould just open the file for reading using whatever
language your program is written in, you don't have to open it with Word for
it to get a file lock in the OS. For it to get a useful ock giving the user's
info then you would have ot create a temp file in the right format.
But a good DM should not let the users anywhere near the file store directy
anyway, it should all be brokered by the DMS so that is what would return a
"this file is in use" message, not the native implementation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top