The original is here: https://www.msofficeforums.com/word-vba ... macro.html
The macro posted there lets you select text and run AutoCorrect on it, but it only works for a single word/entry. You need to select the text that corresponds to an entry name and then run the macro. That macro is:
Code: Select all
Sub ApplyAutoCorrect()
Dim i As Long
Dim orng As Range
Set orng = Selection.Range
orng.MoveStartWhile Chr(32)
orng.MoveEndWhile Chr(32), wdBackward
If Len(orng) > 0 Then
For i = 1 To Word.Application.AutoCorrect.Entries.Count
If orng.Text = Word.Application.AutoCorrect.Entries(i).Name Then
Word.Application.AutoCorrect.Entries(i).Apply orng
Exit For
End If
Next i
End If
lbl_Exit:
Exit Sub
End Sub
Code: Select all
Sub AutoCorrectNow2()
' Graham Mayor Bob Sundquist and Charles Kenyon 2015-12-16
' https://www.msofficeforums.com/word-vba/29148-how-replace-wordbasic-autocorrectnow-old-macro.html
' Runs autocorrect on selected text as if it were being retyped
' Not completed - NOT WORKING
'
On Error Resume Next
Dim oWrd As range
Dim Entry As Object
Dim iCount As Long, i As Long
Let iCount = Selection.Words.Count
For i = 1 To iCount
Set oWrd = Selection.Words(i)
For Each Entry In Word.Application.AutoCorrect.Entries
If oWrd.Text = Entry.Name Then
Entry.Apply oWrd
Exit For
End If
Next Entry
Next i
Set oWrd = Nothing
Set Entry = Nothing
On Error GoTo -1
End Sub