![]() |
#2
|
||||
|
||||
![]()
The difficulty with creating a function to perform an autocorrect on a text is in determining what to autocorrect. Auto correct entries can be longer than a word and can include punctuation which throws out the potential word count. The only solution I can see would be to select the text you wish you check against the autocorrect list and then run the macro - something like
Code:
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
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Tags |
autocorrectnow |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro on Search and Replace | davidhuy | Word VBA | 1 | 12-19-2014 04:47 AM |
Need Macro to Replace Text | rsrasc | Word VBA | 2 | 11-10-2014 06:26 PM |
Windows 95 WordBasic (!!!) macro | NobodysPerfect | Word VBA | 4 | 08-25-2014 02:03 AM |
![]() |
amparete13 | PowerPoint | 3 | 03-11-2014 05:29 AM |
![]() |
ubns | Word VBA | 1 | 05-02-2012 12:52 AM |