PC Review


Reply
Thread Tools Rate Thread

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

 
 
barkertj@gmail.com
Guest
Posts: n/a
 
      5th Jun 2007
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!

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWRhbVY=?=
Guest
Posts: n/a
 
      7th Jun 2007
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.
--
Adam Vero
MCP, MOS Master, MLSS, CWNA
http://veroblog.wordpress.com
http://www.meteorit.co.uk


"(E-Mail Removed)" wrote:

> 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!
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I trick XP into thinking it installed a certain critical update(kb095474) XP Guy Windows XP Customization 3 4th Dec 2008 11:53 PM
Word 2007 Missing User Level Securitty - ARRRGGGGHHHH What were they thinking? Steve House Microsoft Access Security 10 9th Jun 2008 04:06 AM
Trick Windows into thinking that OLDFILESERVER still exists. Nick Microsoft Windows 2000 DNS 2 5th Jan 2005 04:10 PM
Trick Windows into thinking that OLDFILESERVER still exists. Nick Microsoft Windows 2000 Networking 1 16th Dec 2004 02:51 PM
Trick the registry into thinking I've logged out. =?Utf-8?B?UGF1bA==?= Windows XP Security 3 8th Oct 2004 02:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:35 AM.