Automatically format text

J

JaneE

I need to create a template where anytime a specific word is typed, that word
only formats automatically. Can anyone help with the coding needed? I'm
new to VB and am struggling with this but I'm hoping that it will be quick
and easy for someone to answer.

Thanks.
 
J

Jay Freedman

JaneE said:
I need to create a template where anytime a specific word is typed, that word
only formats automatically. Can anyone help with the coding needed? I'm
new to VB and am struggling with this but I'm hoping that it will be quick
and easy for someone to answer.

Thanks.

If you did write a macro to do this, it would have to be an event
handler that constantly watches what's being typed. This would be a
horrible performance killer.

Fortunately, you don't need a macro. In any document, type and format
the word the way you want it. Select the formatted word and go to the
AutoCorrect dialog. The word will be shown in the Replace and With
boxes. Click the "Formatted text" option button just above that, and
click Add.

Now any time you type the word and follow it with a space or
punctuation, it'll be replaced with its formatted version.
 
J

JaneE

Yes, but I would have preferred it to be completely automated. Thanks very
much for taking the time to help.
 
J

JaneE

Thank you, Jay. I am doing this for someone else, and had wanted to give
them a fully-automated document. However, the "performance killer" effect
is a good enough reason not to pursue this and merely stick to a more basic
solution. Much appreciated!
 
J

Jay Freedman

Once the AutoCorrect entry is created, the replacement *is* fully
automatic. Is there something else you had in mind?
 
C

Charles Kenyon

You can do this with AutoCorrect and it will be completely automated. Make
sure you save it as a formatted entry.
 

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