views:

312

answers:

1

TortoiseSVN has a nice VBA script that allows to merge Microsoft Word documents using Word builtin change tracking functionality. This way, when I merge changes from a branch into the trunk I can resolve the conflicts in Word documents.

However, the feature is not as useful as it could because it doesn't track revision changes; it just compares the two documents as a whole. This way, when I merge a revision where one paragraph was added to the document I'm not offered to review this paragraph. Instead, I have to review all the differences between the source and target documents (including stuff like TOC bookmark names).

Is it an inherent limitation I cannot override? Or is it due to the fact that my Word version is pretty old? (I'm using Word 2002).

Also, if you know about a magic tool or plugin... ;-)

+3  A: 

If you want to ignore modifications to the TOC you could patch the diff-script so that revisions in the TOC are automatically accepted.

You could e.g. insert the following lines to the file diff-doc.js before the compared document will be shown:

var toc; 
var i; 

for (i = 1; i <= word.ActiveDocument.TablesOfContents.Count; i++)
{
    toc = word.ActiveDocument.TablesOfContents(i);
    toc.Range.Revisions.AcceptAll();    
}
0xA3
Nice trick. TOC is only an example but it's definitively among the most annoying differences. Can it be extended to header and footer? Even though they're the same for all pages, each page seems to count as individual change.
Álvaro G. Vicario
I still see a zillion "Field code changed" notes beside the TOC when I resolve conflicts. Must I change the merge-doc.js script as well?
Álvaro G. Vicario
Yes, probably you need to change that script instead/as well. And yes, it would be possible to extend the patch to headers and footers. In principle, you will have to iterate over the headers/footers and accept all changes.
0xA3