WD: Sample WordBasic Macro to Type All AutoText Entries

Last reviewed: February 3, 1998
Article ID: Q138966
The information in this article applies to:
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1
  • Microsoft Word for Windows, versions 6.0, 6.0a, and 6.0c
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, version 7.0

SUMMARY

The following macro inserts all the AutoText entries in Normal.dot into a new document. The new document includes the name of each entry and separates the entries with horizontal lines.

Note that you can quickly print a list of all AutoText entries by clicking Print on the File menu, and choosing AutoText Entries in the Print What box. (On Word for the Macintosh, the box is named Print.) It is not necessary to use a macro for this method.

MORE INFORMATION

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

   Sub MAIN
      FileNewDefault
      n = CountAutoTextEntries()
      For count = 1 To n
         FormatBordersAndShading .TopBorder = 1
         Bold 1
         Insert AutoTextName$(count) + ":" + String$(2, 13)
         FormatBordersAndShading .TopBorder = 0
         Bold 0
         EditAutoText .Name = AutoTextName$(count), .Insert
         Insert Chr$(13) + Chr$(13)
      Next
      StartOfDocument
   End Sub


Additional query words: entries
Keywords : kbautotext kbmacroexample macword winword word6 word7 word95
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a; MACINTOSH:6.0,6.0.1,6.0.1a
Platform : MACINTOSH Win95 WINDOWS winnt
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 3, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.