Editing AutoText

T

Tonya Marshall

I've messed up with 100+ AutoText entries. What I'm doing is creating
AutoText for medications that has both the product name plus the generic
name in parentheses. They are reversible, so if the generic name is
typed the same AutoText entry appears that would appear if the product
name were typed.
Example: Tylenol (acetaminophen).
The user can start typing Tylenol or acetaminophen and the same
configuration prints.

What I did was add a space after the closing parenthesis and when the
dose is typed TWO spaces are added after the closing parenthesis.

I've wandered around in AutoText hoping I could edit out the space I put
in but there's not far to wander. Does anyone know how to delete that
final space without starting over? Quite a few users are using the 4
templates with the AutoText.

Tonya Marshall
 
J

JudithJubilee

You cannot edit the Autotext entry as such. If you need
to change it insert the entry into a doument and edit
it. Then highlight it and se=ave it as an Autotext entry
with the same original name. It will ask you if you want
to replace the original, say yes.

Hope this helps

JudithJubilee
 
M

Mark Tangard

Tonya,

Next time (ok ok, we always hope there's no next time), ask
this sort of thing in one of the VBA newsgroups. Rather than
re-input 100+ AutoTexts you could've used a macro to handle
it all, and this is the sort of task that a half-dozen MVPs
(well, ok, me at least ) would've jumped at.
 
D

Doug Robbins - Word MVP

Hi Tonya,

The following (untested) may do the trick:

Dim atEntry As AutoTextEntry

For Each atEntry In _
ActiveDocument.AttachedTemplate.AutoTextEntries
atEntry.Value = Trim(atEntry.Value)
Next atEntry

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

Tonya Marshall

Thanks Doug. I'm forwarding this to myself at work. I haven't changed the
autotext in the other 3 templates so it will give me a chance to try it out.
I'll repost to let you know how it works.
 
T

Tonya Marshall

I didn't quite know how to use the macro - whether to make it an AutoExec or
AutoNew macro or put the macro on a toolbar.
I named it and put it on a toolbar and ran it before using the template, but the
extra space still generates.
Tonya Marshall
 
T

Tonya Marshall

Oops! I tried it here at home and it's working. (Think it's gremlins). I ran the
macro in the template and saved it. It removed all of the spaces after the entries
in the AutoText dialog. When I opened a new document from the template, no autotext
entries had extra spaces after them.

This is a good macro. I hadn't used AutoText this extensively to know that a space
is generated automatically after an entry.

Tonya Marshall
 
M

Mark Tangard

I'm pretty sure no extra space is generated after an AutoText
entry; however, it's quite a common mistake, when selecting
material you want to make into an AutoText entry, to select
the words just as you'd select text during editing -- which
*includes* the trailing space if there is one.
 
T

Tonya Marshall

The extra space was mine. I deliberately copied a space after the autotext entry thinking
I could just start typing without pressing the spacebar after the autotext entry. My space
plus the automatic space after the entry made 2 following spaces. The space appears when
something is typed after the autotext entry; the space generates automatically whether the
spacebar is pressed or not but it is only a single space unless, like I did, a space is
copied into the autotext.
Tonya Marshall
 
S

Suzanne S. Barnhill

I don't get a space after an AutoText entry when I insert it. How are you
inserting the entries--using F3, by pressing Tab or Enter when you get the
AutoComplete tip, or what? I could understand the space if we were talking
about AutoCorrect, since AutoCorrect doesn't fire until you add a space or
punctuation mark.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
T

Tonya Marshall

Do an autotext entry and type 2 or 3 letters after it (don't press the space
bar). A space is automatically inserted. My entries had a space after them so
when I started typing after the autotext insertion my space and the automatic
one made 2 spaces.

I press the enter key after the AutoComplete tip comes up. Now that the spaces I
inserted with the autotext are gone, I just get one space whether I press the
spacebar or not after I type more text after the autotext entry.

I didn't know the F3 key would enter it also, but using it then typing text
after the entry, there's still a space generated without pressing the spacebar.
Tonya Marshall.
 
Top