Word

List all AutoCorrect entries in new document

Ease of Use

Easy

Version tested with

2000, 2002, 2003 

Submitted by:

MOS MASTER

Description:

The sub will add a new document with a list of all AutoCorrect entries. 

Discussion:

It's very easy to add a new AutoCorrect entry, but sometimes you forget which ones you've already got. This sample will make a quick list for you to compare. 

Code:

instructions for use

			

Option Explicit Sub ListAutoCorrect() Dim oEntry As Word.AutoCorrectEntry With Application ' \\ Turn screenupdating off .ScreenUpdating = False ' \\ Add new document .Documents.Add ' \\ Loop through all AutoCorrect entries For Each oEntry In AutoCorrect.Entries ' \\ Work with selection With .Selection ' \\ Make all AutoCorrect names Bold .Font.Bold = True .TypeText Text:=oEntry.Name .TypeParagraph ' \\ Insert Para ' \\ Turn of Bold for the AutoCorrect values .Font.Bold = False ' \\ Insert entry .TypeText Text:=oEntry.Value ' \\ Insert two paragraphs .TypeParagraph .TypeParagraph End With Next ' \\ Turn screenupdating back on .ScreenUpdating = True End With End Sub

How to use:

  1. Open your Word document.
  2. Press Alt + F11 to open VBE.
  3. Insert-Module. (Insert -> module)
  4. Paste the code there in the window at right. (F7)
  5. Close VBE (Alt + Q or press the X in the top right hand corner).
  6. Save the file.
 

Test the code:

  1. From Word, press Alt + F8 to open the macro dialog box.
  2. Select ListAutoCorrect
  3. Click Run.
 

Sample File:

List Autocorrect entries.zip 7.57KB 

Approved by mdmackillop


This entry has been viewed 65 times.

Please read our Legal Information and Privacy Policy
Copyright @2004 - 2020 VBA Express