All I know about autopopulation is that it can be done.
I've never used a listbox but it looks like it might work, especially
scrolling with a checkbox for each entry. I'm not sure it is an improvement
over the standard AutoText toolbar, but that is up to you.
The style an AutoText entry is saved in is only marginally related to the
style that will be used when it is inserted. If the entry has one or more
paragraph marks as part of the entry, those paragraph marks (and the related
formatting including styles) will be carried into your new document. The
style that is at the insertion point will not be changed by insertion of an
AutoText entry. Either the entry ends with a paragraph mark, in which case
the style at the insertion point will be the paragraph following your entry,
or the entry does not end with a paragraph mark, so the last paragraph of
the entry will be formatted using the style at the insertion point.
Obviously AutoText entries are organized in Word according to the style used
when they were saved. Again, that is the style for the last paragraph of
multi-paragraph entries.
I hope others can help you with the population question. You might want to
post a separate message on that with a subject of "populate listbox with
AutoText entry names."
Note that you will want to use the AutoTextEntries.Insert method to put them
into your document.
--
Charles Kenyon
See the MVP FAQ: <URL:
http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
D said:
Okay, let me try and restate what I think would work best. A lot of the
points mentioned make sense. So, now I'm thinking the best way to do it
would be a userform. When a certain macro is run, this userform would be
displayed, and each autotext entry under the "Plain text" style would be
listed in a listbox on the userform. Each choice in the listbox (set to a
rather large size, about the height of the Word window.) would be one of the
autotext entrys. Using a Click event, each time one of the lines is
clicked, that autotext would be inserted. Basically, a way of having all
the autotext entries always displayed on the right hand side of the screen,
ready to be used until the userform is closed.
The main hang up is trying to autopopulate the list box with all the
autotext entries, each time the userform is displayed. And having each one
of these listed entries insert the appropriate autotext when clicked. It
seems like that would be rather easy, since the listed name of the autotext
in the listbox would be the entry's real name, and could be put into a
variable that would be used to insert an autotext with that variable's name.
It's just the autopopulate thing that has me hung up. Another problem might
be trying to list just the autotext entries under the "Plain text" style,
and getting them to use that style when inserting them. When I insert an
autotext from the normal autotext menu, it inserts with the appropriate
style. But if I insert the same autotext using a macro, it inherits the
style at the insertion point.