比较多个单词文档中的段落以识别可能的变量 [英] comparing paragraph in multiple word documents to identify the possible variables

查看:77
本文介绍了比较多个单词文档中的段落以识别可能的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文件夹中有大约278个html文件,这些文件将被更改为合并文档。 我一直在手动执行此操作,打开每个html文件,删除残留图形,更正适用的格式错误,然后阅读每个文档
以查找包含更改的段落。 我在互联网上搜索了一个加速的宏观 整个过程但没有找到。 所以,我要求有人为我创建一两个? 

I have approximately 278 html files in a folder that will be changed to merge documents.  I have been doing this manually, opening each html file, removing residual graphics, correcting formatting errors where applicable, then reading through each document to find the paragraphs with changes.  I have searched the internet for a macro to speed  up the process but found none.  So, I am asking someone to create one or two for me? 

我可以使用任何版本的单词录制和运行基本宏,但不能写一个。因此,如果您可以请创建整个代码并包含有关如何运行它的说明。 

I can record and run a basic macro using any version of word but cannot write one. So, if you can please create the entire code and include instructions on how to run it. 

非常感谢您的帮助。

宏,应该

提示我选择带有html文件的文件夹

prompt me to select the folder with the html files

提示我选择保存转换后的单词(.docx)文件的文件夹

prompt me to select the folder to save the converted word (.docx) files

文件并转换并保存到word文件夹

after all the files and converted and saved to the word folder

打开每个转换后的word文件并允许我运行清理宏

open each of the converted word files and allow me to run my clean up macros

所以我猜我需要另一个消息框提示(完成后单击确定)。

so I guess I would need another message box prompt (click ok when complete).

然后关闭并保存每个(返回同一文件夹)

then close and save each (back to the same folder)

完成所有清理后,宏应该:

after all the clean up is completed, the macro should:

打开第一个文档和第二个文档

Open the first document and the second document

将第一个文档的每个段落与第二个文档的每个段落进行比较。

compare each paragraph of the first document to each paragraph of the second document.

忽略表格图形和空行。

如果找到匹配项,请更改 中的唯一文字的颜色该段暗红色然后移动到第一个文档的下一段并开始与第二个文档的第一段进行比较。

If a match is found, change the color of the unique text in that paragraph dark red then move to the next paragraph of the first document and begin comparing against the first paragraph of the second document.

如果找不到匹配项,则比较第一段中的段落文件到第二个文件的下一段

if no match is found, then compare the paragraph in the first document to the next paragraph in the second document

继续到第二个文件的末尾,然后将下一个段落与文件
中的第一段进行比较

continue to the end of the second document then compare the next paragraph to the firs paragraph in document

使用新名称保存比较文档,该名称将比较文件的名称组合在一个新文件夹中(提示选择文件夹并继续确定)

save the compared documents with a new name that combines the name of the compared file in a new folder (prompts to select the folder and continues on ok)

继续,直到原始文件夹中的文件中没有其他文件。

continue until there is no more files in the files in the original folder.

宏将每个段落视为单独的文档,并与单词中的文档比较功能进行比较。

the macro is treating each paragraph as separate document and comparing as with the document compare feature in word.

比较示例:

Document 1lamb

Document 1lamb

Document2 dog

Document2 dog

第1段玛丽有一只小羊羔,它的羊毛像雪一样白。到处都是 玛丽去了羔羊肯定会去。   
可爱的一天。

Paragraph 1 Mary had a little lamb its fleece was white as snow. And everywhere   that Mary went the lamb was sure to go.    Lovely day.

第1段快速的棕色狐狸跳过懒狗。 
狗没看快棕色  fox。

Paragraph 1 the quick brown fox jumped over the lazy dog.  The dog did not look at the quick brown   fox.

第2段。灵巧的棕色狐狸在疲惫的狗身上乱窜。 
这条狗得到了一块快速的棕色狐狸 尾巴。

Paragraph 2. The nimble brown fox jumbled over the tired dog.  The dog got a piece of the quick brown fox   tail.

扭曲的扭转者一旦扭曲扭曲和扭曲的扭曲 是一个三扭曲。现在扭曲扭曲,如果一个扭曲是 哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇哇已经结婚了。

A twister of twist once twisted a twist and the twist that he twisted   was a three twisted twist. Now in twisting that twist if one twist were to   untwist, it would untwist the three twisted twist that the twister of twist   had twitted.

比较文件会看起来像:

Document lambdog

Document lambdog

第1段

  玛丽有一只小羊羔 羊毛像雪一样白。玛丽去羔羊的每个地方都肯定会去<跨度>群组。
可爱的一天。

 Mary had a little lamb its   fleece was white as snow. And everywhere that Mary went the lamb was sure to   go.  Lovely day.

第2段。


敏捷
棕色狐狸混淆了  累了
狗。  得到了一个 一块
快速棕色狐狸尾巴

The nimble brown fox jumbled over   the tired dog.  The dog got a   piece of the quick brown fox tail.

推荐答案

这是讨论Microsoft Word问题和反馈的论坛,问题与Word 编码/编程有关,你呢?最好将您的问题发布到Word的MSDN论坛

This is the forum to discuss questions and feedback for Microsoft Word, the issue is more related to Word coding/programing, you'd better post your question to the MSDN forum for Word

http://social.msdn.microsoft.com/Forums/en-US/home?forum=worddev&filter=alltypes&sort=lastpostdesc

我们建议适当发布的原因是您将获得最合格的受访者群体,而定期阅读论坛的其他合作伙伴可以分享他们的知识或从您与我们的互动中学习。感谢您的理解。

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

George Zhao

TechNet社区支持

George Zhao
TechNet Community Support


这篇关于比较多个单词文档中的段落以识别可能的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆