English 中文(简体)
删除所有重复的字句
原标题:Macro to delete all repeated instances of text in word doc
  • 时间:2011-01-28 20:06:35
  •  标签:
  • vba
  • ms-word

I m 寻求以简单的方式删除在《2007年语言文件》中重复的案文。 如果Find/Replace指挥部有一些短员,我就看不到。 否则,有人可以建议我如何写出像以下这样的宏观:

1- Select a block of text (could be mulitple paragraphs, have bullet points, etc).
2- Run the macro or do the command.
3- The macro or command deletes all instances of the selected text block.

这里有什么见解?

最佳回答

www.un.org/Depts/DGACM/index_french.htm

原则上,你替代指挥的星号是:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
    .Text = Selection.Text
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll

您以空洞取代,从而删除了案文的每一个例子。

但是:你当然必须决定如何处理选定案文的格式,也许首先必须分析你选定的部分,因为更换的果园可能不会用选择”所忽略的控制果园。 文本 ...... 这只是一开始,你需要具体说明你想要的东西,然后再次问问,或问我们。 同时,Record Mac和vba reference是你的朋友。

问题回答

甲型号(有新条线)的案文,如果你在子弹、新段落等现场,你就可以使用Find/Replace。 它将不再进行准确的配对。 如果你经常需要这样做,我建议采用“LaTeX”等方案来撰写你的文件。 Later 第十条允许你以这种方式对大块案文进行精确对比。 如果您在视窗机器上再读,大型的“TeX”仪器将安装在

我的问题完全相同,邮寄名单庞大,我刚刚需要电子邮件。 我通过将案文复制成Excel,用句子(或子弹)过滤句,一段希望删除并删除所有各行。 地雷超过270页,只做罚款(只要案文不长,其速度远远快于用字句取代句子)。 或者,如果是一种选择,只是用文字过滤器过滤——从“到:”开始,那么你是在10个秘密中做的。 希望会有所助益。

Just Press Ctrl+ H - 选择和替换案文, 您希望删除的案文类型, 以及





相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签