AutoText retrieval.

  • Thread starter Roderick O'Regan
  • Start date
R

Roderick O'Regan

I want to create a VBA routine to attach to a Word XP toolbar button which
when selected will display the AutoText entries relating only to the
template attached to the new active document.

At present I am using SendKeys in the following way to achieve the desired
result but am thinking that there must be a better method of doing this:

SendKeys "%iax" & "%l" & "LTSB Tender" & "{Enter}" & "{Tab}" & "{Enter}",
True

This simulates the reader selecting Insert|AutoText|AutoText, going to the
"Look in" field and then typing "LTSB etc" to select the appropriate
template and then completing the operation of tabbing to the OK button and
selecting it. Crude, I know. But it works. Any new results I apply will also
have to Work in Word 97 as some users are still on that version.

Could anyone help with this challenge, please?

Regards

Rod
 
C

Cindy M -WordMVP-

Hi Roderick,

I don't think you have any choice but SendKeys to perform the actions within
the dialog box. But you can, at least, SHOW the dialog box directly. Try
something like this:

SendKeys "%l" & "LTSB Tender" & "{Enter}" & "{Tab}" & "{Enter}",
True
Dialogs(wdDialogEditAutoText).Show
I want to create a VBA routine to attach to a Word XP toolbar button which
when selected will display the AutoText entries relating only to the
template attached to the new active document.

At present I am using SendKeys in the following way to achieve the desired
result but am thinking that there must be a better method of doing this:

SendKeys "%iax" & "%l" & "LTSB Tender" & "{Enter}" & "{Tab}" & "{Enter}",
True

This simulates the reader selecting Insert|AutoText|AutoText, going to the
"Look in" field and then typing "LTSB etc" to select the appropriate
template and then completing the operation of tabbing to the OK button and
selecting it. Crude, I know. But it works. Any new results I apply will also
have to Work in Word 97 as some users are still on that version.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top