软件:word
版本:2007
我录制了一个宏
大致上就是,找到一个样式,然后在它前、后各加上一个特殊符号
但只能执行一次
请问要如何一直执行到文件最后呢?
附上我的宏:
Sub 套word()
'
' 套word 宏
'
'
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("word")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="★"
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("word")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="☆"
End Sub