Word

List all Autotext entries from Normal.dot

Ease of Use

Easy

Version tested with

2000, 2002 

Submitted by:

MOS MASTER

Description:

The sub will add a new document with a list of all Autotext entries in Normal.dot 

Discussion:

It's very easy to add a new Autotext entry to Normal.dot 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 ListAutoText() Dim oAutoText As Word.AutoTextEntry With Application ' \\ Turn screenupdating off .ScreenUpdating = False ' \\ Add new document .Documents.Add ' \\ Loop through all Autotext entries in Normal.dot For Each oAutoText In NormalTemplate.AutoTextEntries ' \\ Work with selection With .Selection ' \\ Make all Autotext names Bold .Font.Bold = True .TypeText Text:=oAutoText.Name .TypeParagraph ' \\ Insert Para ' \\ Turn of Bold for the Autotext entries .Font.Bold = False ' \\ Insert entry oAutoText.Insert Where:=.Range, RichText:=True ' \\ 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 ListAutoText
  3. Click Run.
 

Sample File:

List Autotext.zip 7.69KB 

Approved by mdmackillop


This entry has been viewed 67 times.

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