The information in this article applies to:
SUMMARYWhen you write macros in Microsoft Word for Windows, it may be necessary to test for the existence of an AutoText ("glossary" prior to Word 6.0) entry before inserting the contents of the entry. If your macro does not check for the existence of an AutoText entry before attempting to insert the contents into the document, you may receive one of the following error messages: Word 6.x, 7.x
Word 1.x, 2.x
MORE INFORMATIONThe following WordBasic macros test for an existing AutoText (glossary) entry. Word 6.x, 7.xWARNING: 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.If the "test" AutoText entry resides in the Normal template, the following macro inserts the contents of the AutoText entry at the insertion position in the document. If the "test" entry does not exist in the Normal template, this macro example posts a message indicating that it does not exist.
Word 2.xIf the "test" Glossary entry resides in the Normal template, the following macro inserts the contents of the Glossary entry at the insertion position in the document. If the "test" entry does not exist in the Normal template, this macro example posts a message indicating that it does not exist.
The following WordBasic macro tests for an existing glossary entry named
"test" in the active template (template other than Normal):
The context of the GetGlossary and EditGlossary commands above is set to
template instead of global.
These commands operate the same if the word Glossary is replaced by the word AutoText when Word 6.0 is used. REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, pages 183 and 228 Additional query words: winword2 winword word95 word6 GetGlossary Insert Glossary AutoText GetAutoText macword word7
Keywords : kbmacro kbmacroexample |
Last Reviewed: October 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |