使用 TortoiseSVN 合并 Microsoft Word 文档

发布于 2024-08-26 06:12:43 字数 330 浏览 4 评论 0原文

TortoiseSVN 有一个很好的 VBA 脚本,允许使用 Word 内置更改跟踪功能合并 Microsoft Word 文档。这样,当我将分支中的更改合并到主干时,我可以解决 Word 文档中的冲突。

然而,该功能并没有发挥应有的作用,因为它不跟踪版本更改;它只是将两个文档作为一个整体进行比较。这样,当我合并在文档中添加了一个段落的修订时,我不会审阅该段落。相反,我必须检查源文档和目标文档之间的所有差异(包括 TOC 书签名称等内容)。

这是我无法克服的固有限制吗?还是因为我的Word版本太旧了? (我使用的是Word 2002)。

另外,如果你知道一个神奇的工具或插件......;-)

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

注定孤独终老 2024-09-02 06:12:43

如果您想忽略对 TOC 的修改,您可以修补 diff 脚本,以便自动接受 TOC 中的修订。

例如,您可以在显示比较文档之前将以下行插入到文件 diff-doc.js 中:

var toc; 
var i; 

for (i = 1; i <= word.ActiveDocument.TablesOfContents.Count; i++)
{
    toc = word.ActiveDocument.TablesOfContents(i);
    toc.Range.Revisions.AcceptAll();    
}

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();    
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文