[文件] 請問WORD的巨集要如何執行到文件最後?

看板Office作者 (dcjamesw)時間7年前 (2018/05/16 11:32), 編輯推噓0(001)
留言1則, 1人參與, 7年前最新討論串1/1
軟體: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 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.51.221.156 ※ 文章網址: https://www.ptt.cc/bbs/Office/M.1526441555.A.9FF.html

05/16 12:13, 7年前 , 1F
05/16 12:13, 1F
文章代碼(AID): #1Q-wPJd_ (Office)
文章代碼(AID): #1Q-wPJd_ (Office)