MS-Word宏——替换——下班后确认
MS-Word Macro - replace - confirming after work
我不是工程师,也不是IT工作者。但我是……体育记者。
我在路上写了很多文章。我用这个 Google Voice。但是 Google Voice 中的波兰语存在一个问题。它不会...转换标点符号。
我在 Microsoft Word 中创建了宏。但这不是我 100% 满意的。我在完成所有工作后无法确认更改。
使用我的宏后,我需要在其工作后按下按钮 'YES'。 MS-Word 问我:"MS-Word finished searching of selected text. Numbers of changes: 0/1/2 etc. Should I search the rest of the document?".
我在 Macro 中有 11 个替换,我需要的每个词都按 YES... 11 次(即使它替换了 0 次):)
我附上了我的宏,也许你们社区的人可以帮助和修改我的想法。非常感谢,致以最诚挚的问候。
Sub GoogleVoice()
'
' GoogleVoice Makro
'
'
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " przecinek"
.Replacement.Text = ","
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " kropka"
.Replacement.Text = "."
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " dwukropek"
.Replacement.Text = ":"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "myślnik"
.Replacement.Text = "-"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " znak zapytania"
.Replacement.Text = "?"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " wykrzyknik"
.Replacement.Text = "!"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " cudzysłów"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " zamknij nawias"
.Replacement.Text = ")"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "trzykropek"
.Replacement.Text = "..."
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " nawias "
.Replacement.Text = "("
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " enter"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
提示是由wdFindAsk引起的。您的代码也可以大大简化。尝试:
Sub GoogleVoice()
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Text = " przecinek"
.Replacement.Text = ","
.Execute Replace:=wdReplaceAll
.Text = " kropka"
.Replacement.Text = "."
.Execute Replace:=wdReplaceAll
.Text = " dwukropek"
.Replacement.Text = ":"
.Execute Replace:=wdReplaceAll
.Text = "myslnik"
.Replacement.Text = "-"
.Execute Replace:=wdReplaceAll
.Text = " znak zapytania"
.Replacement.Text = "?"
.Execute Replace:=wdReplaceAll
.Text = " wykrzyknik"
.Replacement.Text = "!"
.Execute Replace:=wdReplaceAll
.Text = " cudzysłów"
.Replacement.Text = """"
.Execute Replace:=wdReplaceAll
.Text = " zamknij nawias"
.Replacement.Text = ")"
.Execute Replace:=wdReplaceAll
.Text = "trzykropek"
.Replacement.Text = "..."
.Execute Replace:=wdReplaceAll
.Text = " nawias "
.Replacement.Text = "("
.Execute Replace:=wdReplaceAll
.Text = " enter"
.Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub
我不是工程师,也不是IT工作者。但我是……体育记者。
我在路上写了很多文章。我用这个 Google Voice。但是 Google Voice 中的波兰语存在一个问题。它不会...转换标点符号。
我在 Microsoft Word 中创建了宏。但这不是我 100% 满意的。我在完成所有工作后无法确认更改。
使用我的宏后,我需要在其工作后按下按钮 'YES'。 MS-Word 问我:"MS-Word finished searching of selected text. Numbers of changes: 0/1/2 etc. Should I search the rest of the document?".
我在 Macro 中有 11 个替换,我需要的每个词都按 YES... 11 次(即使它替换了 0 次):)
我附上了我的宏,也许你们社区的人可以帮助和修改我的想法。非常感谢,致以最诚挚的问候。
Sub GoogleVoice()
'
' GoogleVoice Makro
'
'
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " przecinek"
.Replacement.Text = ","
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " kropka"
.Replacement.Text = "."
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " dwukropek"
.Replacement.Text = ":"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "myślnik"
.Replacement.Text = "-"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " znak zapytania"
.Replacement.Text = "?"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " wykrzyknik"
.Replacement.Text = "!"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " cudzysłów"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " zamknij nawias"
.Replacement.Text = ")"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "trzykropek"
.Replacement.Text = "..."
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " nawias "
.Replacement.Text = "("
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " enter"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
提示是由wdFindAsk引起的。您的代码也可以大大简化。尝试:
Sub GoogleVoice()
Application.ScreenUpdating = False
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Text = " przecinek"
.Replacement.Text = ","
.Execute Replace:=wdReplaceAll
.Text = " kropka"
.Replacement.Text = "."
.Execute Replace:=wdReplaceAll
.Text = " dwukropek"
.Replacement.Text = ":"
.Execute Replace:=wdReplaceAll
.Text = "myslnik"
.Replacement.Text = "-"
.Execute Replace:=wdReplaceAll
.Text = " znak zapytania"
.Replacement.Text = "?"
.Execute Replace:=wdReplaceAll
.Text = " wykrzyknik"
.Replacement.Text = "!"
.Execute Replace:=wdReplaceAll
.Text = " cudzysłów"
.Replacement.Text = """"
.Execute Replace:=wdReplaceAll
.Text = " zamknij nawias"
.Replacement.Text = ")"
.Execute Replace:=wdReplaceAll
.Text = "trzykropek"
.Replacement.Text = "..."
.Execute Replace:=wdReplaceAll
.Text = " nawias "
.Replacement.Text = "("
.Execute Replace:=wdReplaceAll
.Text = " enter"
.Execute Replace:=wdReplaceAll
End With
Application.ScreenUpdating = True
End Sub