A family of Microsoft word processing software products for creating web, email, and print documents.
What is wrong with this error correction macro? Macros in which Word takes out a misspelled word and inserts the correct spelling (Word for Mac)
I am writing more and more replacement macros as the weeks and years go by. These are macros in which Word takes out a misspelled word and inserts the correct spelling.
I have been copying the text of the macro from one misspelling to the next. This time, though, I get in Visual Basic Editor (VBE) what I assume to be an error notice:
Sub until()
'
' until Macro
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "unti!"
.Replacement.Text = "until"
.Forward = Tru
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I presume that the red color of the "sub" line means a problem. I have not yet tested this macro.
A further note: I list all of these replacement macros in one module in VBE. I draft the text of each macro in a Word file that I keep in Documents. Then I copy and paste a new macro into the VBE module. Every other time I do this, VBE draws a horizontal line after the End Sub of the last listed macro and before the Sub ...() of the new macro. And then VBE shows the text in black. But VBE does not insert that line when I try to paste this new macro into the existing module. And it leaves the first two lines in red and green.
I do not know of any problem with this VBE module; I have dozens of versions of this replacement macro in there. The only difference among the macros is the specific replacement to be done by each macro.
Does anyone have any insight into why this Sub until() does not paste into the VBE module?
TIA
Microsoft 365 and Office | Word | For business | MacOS
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.