Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge Microsoft Word documents with TortoiseSVN

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... ;-)

like image 492
Álvaro González Avatar asked Mar 22 '10 11:03

Álvaro González


People also ask

Does Git work well with Word documents?

Git and GitHub do commits on pretty much any file type for writing, although it works best with plain text. If you write in Microsoft Word, it'll work, but you won't be able to see your past commits on the command line or in GitHub.


1 Answers

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();    
}
like image 102
Dirk Vollmar Avatar answered Oct 02 '22 22:10

Dirk Vollmar