Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-11-2022, 07:19 PM
Charles Kenyon Charles Kenyon is offline How to replace WordBasic.AutoCorrectNow in an old macro? Windows 10 How to replace WordBasic.AutoCorrectNow in an old macro? Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,530
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Here is one that handles more including multi-word AC entries. It is slow but may be worth using.
Code:
  Sub AutoCorrectBruteReplace2()
      ' https://answers.microsoft.com/en-us/msoffice/forum/all/macro-for-autocorrect/91f9bdb1-47ac-4cec-9842-5f1ee38bd7cf?page=1
      ' rianvillareal 2022-06-11 modified by Charles Kenyon with help by Hans Vogelar to use range and work with selected text
      ' It is slow. Handles multi-word entries. Does not handle fractions
      ' If text is selected, it operates only on selected text
      '       If nothing selected, it operates on entire document
      '
      Dim oEntry As Word.AutoCorrectEntry
      Dim oRng   As range
      Set oRng = Selection.range
      For Each oEntry In AutoCorrect.Entries
          With oRng.Find
              .ClearFormatting
              .Replacement.ClearFormatting
              .Text = oEntry.Name
              .Replacement.Text = oEntry.Value
              .Forward = True
              .Wrap = wdFindStop
              .Format = False
              .MatchCase = False
              .MatchWholeWord = True
              .MatchWildcards = False
              .MatchSoundsLike = False
              .MatchAllWordForms = False
              .Execute Replace:=wdReplaceAll
          End With
      Next
  End Sub
Reply With Quote
 

Tags
autocorrectnow



Similar Threads
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
How to replace WordBasic.AutoCorrectNow in an old macro? Find and Replace Macro amparete13 PowerPoint 3 03-11-2014 05:29 AM
How to replace WordBasic.AutoCorrectNow in an old macro? Macro - replace with condition ubns Word VBA 1 05-02-2012 12:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft