Hi Tsu Dho,
I think you are confusing two different things.
First of all, I have to make an assumption because you were not very clear
on what you are trying to achieve. I assume that you are trying to insert in
an AUTOTEXT entry at the cursor in the active document.
So, autocorrect entries are those you set up so that if you type, for
example, "laed" Word will automatically change it to "lead". As such, it is
not something you can insert in a document at the cursor. But you can
enumerate them in VBA and modify them...
Next, you are talking about autotext. Now, this is something you can insert
at the cursor from VBA.
For example, from the Word help:
Selection.Collapse Direction:=wdCollapseEnd
NormalTemplate.AutoTextEntries("TheWorld").Insert _
Where:=Selection.Range, RichText:=True
Using ", RichText:=True" is vey important if you want to preserve the
formatting that was used to create the autotext.
or, if you have a template that contains the Autotext (not necessarily the
one used to create the current document), you may want to play around with
something like:
Templates("D:\MyPath\MyGlobalTemplate.dot").AutoTextEntries("Test").Insert _
Where:=Selection.Range, RichText:=True
I hope that I managed to make sense of that topic for you!
Cheers!
--
_______________________________________
Jean-Guy Marcil
(e-mail address removed)
Tsu Dho Nimh said:
WORD claims: "A collection of AutoCorrectEntry objects that represent all
the AutoCorrect entries available to Word. The AutoCorrectEntries collection
includes all the entries in the AutoCorrect dialog box (Tools menu)."
Well, although I can see and manually insert autotexts from the attached
and the loaded global templates, I can't insert them by name from a macro if
they are in the global template. This puts a serious dent in our plan to
use global templates as storage for autotexts ... any solutions?