Detecting when Autotext is being suggested by Word

R

Rich007

I have a macro which runs every time the Return/Enter key is pressed (I know,
risky!). It checks for the current style and applies a “nice†style if the
user is ending a list (see other post “Ending outline numbered lists when
linked to paragraph style†(see link below)).

I’ve hit my first issue with over-riding the Enter key. If Word detects an
autotext entry is being typed, it shows the “Auto text (Press Enter to
insert)†pop up. If the user hits Enter, my intercept macro runs, does it’s
checks and then performs Selection.TypeParagraph at the end. Unfortunately,
Selection.TypeParagraph does not “execute†the autotext entry.

I’ve found that hitting the Tab key also causes the autotext entry to be
entered, so this is a potential work-around for my users (even though Word
says “(Press Enter to insert)â€, but I would much rather find a better way
round.

I thought of using SendKeys but that didn’t work either.

So, questions:
1) How can I detect in a VBA macro (Word2003) whether Word is in the process
of suggesting an autotext? (If we know that Word is suggesting something then
it’s easy to insert an autotext... if we know what that autotext is).

2) Any heads up on other issues I’m yet to encounter by intercepting the
Enter key? (feel free to come up with an alternative in my other post “Ending
outline numbered lists when linked to paragraph style†posted 8/18/2009:
https://www.microsoft.com/office/co...eral&mid=5c0cdb18-8ce8-42c9-b69e-050a6eb9af37

Many thanks for any advice.
Rich
 

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