Thursday, August 17, 2006

Word Document management using SVN

Seeting Microsoft Word Document Management System
using SVN and TortoiseSVN

Any form of writing is an iterative refinement of thoughts, language, and vocabulary. But, Microsoft Word, one of the most popular editors in the Windows world, does little to facilitate this iterative refinement of the document. Although Microsoft word provides "review" functionality that keeps track of changes in the document, using reviewing functionality makes the document cluttered and messy. Further, Microsoft Word does not provide common functionalities such as comparing, merging, or identifying differences between different versions of the document.

Managing multiple versions of a software code (written in java, C, etc) is a well established technology in the software development world. One such tool that facilitate managing multiple version of the software code is SVN. Yesterday, after getting frustrated with the limited capability of the Microsoft word in managing multiple version of the document, I thought of using SVN. After Googling and searching on blogs, I found that SVN along with TortoiseSVN can be used to setup a free home-made document management system for maintaining word documents. To get you an idea of the power of this free document management system, below is the image of the Microsoft Word (2007) that shows different version of the same document. Notice "new addition" in the title.

The image below shows the
1. The current document on which I am working (lower right panel)
2. The previous version of the same document (upper right panel)
3. Changes in the document. New additions are shown in Red Color (middle panel)
4. Only changes (left panel)




Step by Step instructions to setup Microsoft word document management system
1. download latest SVN
2. Install SVN with default setting
3. Download TortoiseSVN
4. Install TortoiseSVN with default settings
5. After restarting the computer, create a folder, title SVN, on C:\ drive i.e. C:\SVN
6. Right click on the "SVN" folder and select TortoiseSVN > Create Repository here (see fig 2) Select default Native filesystem (FSFS) and click OK. This creates a repository where SVN stores all versions.


7. Now import the files. For this select the folder that contains the files and right click and select TortoiseSVN > Import. In the popup box, select c:\svn for the "url of the repository" and click OK
8. Now create another folder "svn_doc" where ever you want. In this folder we will checkout a copy of all files. For this right click on the folder and select "SVN Checkout" from the context menu.
9. All the files that were imported now should be available in this folder.
10. Now always use files from this new folder. Whenever you edit any file, commit changes to SVN by right click on the file and selecting "SVN commit". To see difference between two versions, select the file and right click and select TortoiseSVN> diff. Mircorsoft word should start and show current file, last saved version, and the differences, as shown in the fig 1.

This setp is required only for Microsoft Office 2007
1. To be able to see the differences in the *.docx file, right click on any file and select TortoiseSVN > setting. In the tree view select Diff Viewer and click on the "Advanced" Button. Select extension .doc and click on edit. Change "doc" to "docs". Alternatively you can create a new extension "docs" and copy the diff viewer location from "doc".

Enjoy free document management system.