Glenn is inserting an AutoText entry into his document using a macro. When he inserts the entry manually (not from the macro), Word sets the style properly for the entry using the style (Heading 3) stored with the AutoText entry. But when he uses the macro to insert the AutoText entry, the inserted entry shifts to another style (Body Text).
The first thing to check is that there is really a style stored with the AutoText entry. In this case, the style is stored with the entry if the paragraph mark at the end of the text was selected when the entry was defined. (It probably is this way in Glenn's case since the style is set properly when manually inserting the AutoText, but it is still a good thing to check.)
Once you are sure that the style has been saved with the document, you need to take a look at your macro and how the AutoText entry is being inserted. If you have an AutoText entry named "MyText," the normal way to insert it is to use a macro line such as the following:
NormalTemplate.AutoTextEntries("MyText").Insert Where:=Selection.Range
If you want the formatting of the AutoText entry to be used, however, you need to make sure that the optional RichText parameter is used:
NormalTemplate.AutoTextEntries("MyText").Insert _ Where:=Selection.Range, RichText:=True
Your AutoText should now be inserted exactly as you want it to be inserted.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (314) applies to Microsoft Word 97, 2000, 2002, and 2003.
Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!
When you first install Word, it includes a number of pre-defined AutoText entries. If you delete any of these entries ...
Discover MoreNeed a fast, easy way to come up with a list of all the AutoText entries that you've defined? This tip presents two ways ...
Discover MoreMany people create tables and store those tables in AutoText entries for later use. If the formatting of those tables ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments