【发布时间】:2020-07-07 00:59:29
【问题描述】:
我已经录制了一个简单的宏来查找单词“Quantity”,转到该行的末尾并插入一个回车符。我需要重复到文档末尾并退出,否则我将陷入无限循环。
代码:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Quantity:"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.EndKey Unit:=wdLine
Selection.TypeParagraph
【问题讨论】:
-
您遇到的问题是什么?与所有编程一样,请具体说明。
-
“quantity”这个词在文档中重复了不定次数,不知道怎么重复宏,直到文档结束才停止。