Dropbox file locking for shared Word documents
I have a Word document shared with several other people in Dropbox. If a Word document is on a shared drive, users are notified if it is already opened. Since a local copy is opened in a Dropbox folder, multiple users can open and save the file ignorant of the other users state. Is there a way to add another lock to the file so that when one person has it open, others are warned if开发者_开发技巧 they try to open it? I am considering writing a VB macro that creates a token file. It is simplistic and there are corner cases when working offline, but we need something to avoid or at least be alerted to conflicts.
Our team used Notifybox for several months to check-out and check-in shared Excel and Word files in Dropbox. Some of the issues with Notifybox are that it sometimes misses file opens and closes, seems to block reboots on Windows XP, sometimes falsely concludes that there is no active internet connection on that PC even though Dropbox is having no problem synchronizing files, and doesn't run on Macs.
I came up with some simple Visual Basic for Applications (VBA) macros that handle file check-out and check-in. We have been using them on PCs running Office 2010 and Macs running Office 2011. They have been designed to work with Office 2003 on PCs and Office 2004 on Macs but have not yet been tested in those environments.
The way the macros work is that when a file is checked-out to a user, that user’s name is stored as "Manager" name in the file’s built-in properties and the revised file is immediately saved and synchronized through Dropbox.
If another user attempts to open a file that has been checked out to someone else, they will get a message that the file is currently being edited and the name of the other user is displayed.
When the first user completes editing the file and closes it, the Manager's name in the file’s built-in properties is set empty and the file is immediately saved and synchronized through Dropbox thereby checking in the file so someone else can check it out.
We add the macros to each shared file. You can read the documentation and download the macros at http://www.ocn.me/comacs.htm.
In the present version, if a user checks-out a file and then uses File Save As to save that file under another name, the file under the new name is checked-out to that user but the original file is not checked-in. The user is asked to reopen the original file and then close it. That will check-in the original file. Likewise, if when closing a file the user decides to discard changes, the file remains checked-out to the user. If someone leaves a file checked-out then goes on vacation, anyone can open the file and delete the Manager name in the file’s built-in properties. That will force a check-in of the file.
The macros are working great for our team. I think they could be fairly easily modified to work with other synchronization products such as Google Drive, SugarSync, or Box.com
Using dropbox for this purpose is always going to have lag issues -- it simply doesn't synchronize fast enough for any "real-time" file locking solution to work.
I suppose a VB macro could write to some central database or web service, which would then be checked on each attempt to open the file -- but as you say, you would need to code for disconnected operation, and then have some way of handling merges after connectivity is restored.
I'm not sure if you have access to SharePoint, but this is really the core of what SharePoint was designed to do best, to let people safely collaborate on Microsoft Office files over a network. There is a free version of SharePoint 2010 out that you could use in an intranet setup.
精彩评论