开发者

Merge Microsoft Word documents with TortoiseSVN

开发者 https://www.devze.com 2022-12-23 13:41 出处:网络
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 reso

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 u开发者_如何学JAVAsing Word 2002).

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


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();    
}
0

精彩评论

暂无评论...
验证码 换一张
取 消