Taking a cue from the programming world, I integrated the subversion concept and used it for document construction in MS Word. I wanted to make the process invisible to the user, so that every time they saved their document, it was not only saved as expected in the location they expected, but additionally, a micro-version of the document could then be retrieved exactly as it existed when saved, regardless of additional changes and saves. As any geek knows, this is exactly what SVN does for you; any time a commit action is invoked, the items under version control are written and retrievable in the state they were at that time regardless of subsequent changes. Typically, this is at the end of a coding cycle, but there is no reason why the "cycle" can't be shortened to be every time the user clicks Save for a document, is there? I couldn't think of any, so I went ahead and did it.
The process is fairly straightforward and can be divided into two clearly defined sets of actions:
- Establish the SVN repository to receive all the micro-versions; and,
- Hook MS Word actions to SVN commands.
In order to create the repository, you need to install a subversioning client. I used Tortoise, as it is easy to set up and run. It's an open source project, so feel free to donate.
After you have downloaded and installed Tortoise, you now have your framework established for creating your repository. You can use the Tortoise interface, or you can do it simply by modifying the following batch file. As displayed, this batch file creates a SVN repository called "drafting" on a network drive. The process creates the remote folder necessary called "work_svn", and it creates the repository for my local C:\Work_Documents folder:
cd /d g:\work_svn
svnadmin create drafting
svn import C:\Work_Documents file:///g:/work_svn/drafting -m "initial import"
svn checkout file:///g:/work_svn/drafting C:\Work_Documents
Coming up next in Part 2: hooking the Save Action of MS Word to automatically commit the changes to a document in my Work_Documents folder, every time I save it.