The following does _not_ work but may give you a start:
Sub ListAutoTextEntries()
Dim oAddIn As AddIn
Dim oTemplate As Template
Dim oATEntry As AutoTextEntry
Dim intCount As Integer
Dim strTemplateName As String
intCount = Application.AddIns.Count
If intCount > 0 Then
For Each oAddIn In Application.AddIns
strTemplateName = oAddIn.Path & "\" & oAddIn.Name
intCount = Templates(strTemplateName).AutoTextEntries.Count
If intCount > 0 Then
For Each oATEntry In Templates(strTemplateName) ' error message
generated
ATEntryInsert strTemplateName, oATEntry.Name
Next oATEntry
End If
Next oAddIn
End If
intCount = Application.Templates.Count
If intCount > 0 Then
For Each oTemplate In Application.Templates
strTemplateName = oTemplate.Path & "\" & oTemplate.Name
intCount = Templates(strTemplateName).AutoTextEntries.Count
If intCount > 0 Then
For Each oATEntry In Templates(strTemplateName)
ATEntryInsert strTemplateName, oATEntry.Name
Next oATEntry
End If
Next oTemplate
End If
End Sub
Sub ATEntryInsert(strTemplate As String, strATEntry As String)
Dim oTemplate As Template
Set oTemplate = Templates(strTemplate)
oTemplate.AutoTextEntries(strATEntry).Insert _
Selection.Range, _
RichText:=True
With Selection
.Move Unit:=wdParagraph
.InsertParagraphAfter
.Collapse Direction:=wdCollapseEnd
End With
Selection.InsertBreak Type:=wdPageBreak
Selection.Range.Collapse wdCollapseEnd
With Selection
.Move Unit:=wdParagraph
.InsertParagraphAfter
.Collapse Direction:=wdCollapseEnd
End With
End Sub
=====================
The following may help. It is a macro that creates a document with a table
containing all the AutoText entries in a particular Add-In. It works.
Sub GetAutoTextEntries()
Dim oTemplate As Template
Dim oEntry As AutoTextEntry
Dim iAutoTextCount As Integer
Dim sAutoTextEntry As String
Set oTemplate = Application.Templates("C:\Data\MS Office User System
Files\Utilities\KenyonMasterAdd-In01.dot")
iAutoTextCount = oTemplate.AutoTextEntries.Count
Application.ScreenUpdating = False
Application.Documents.Add
ActiveDocument.Tables.Add Range:=ActiveDocument.Range(Start:=0, End:=0),
NumRows:=1, NumColumns:=2
ActiveDocument.Tables(1).Rows(1).Cells(1).Select
Selection.Text = "AutoText Name"
ActiveDocument.Tables(1).Rows(1).Cells(2).Select
Selection.Text = "AutoText Entry"
' ActiveDocument.Tables(1).Rows(1).HeadingFormat = True
ActiveDocument.Tables(1).Rows.Add
' ActiveDocument.Tables(1).Rows.Last.Cells(1).Range.Text = "1"
For Each oEntry In oTemplate.AutoTextEntries
sAutoTextEntry = oTemplate.AutoTextEntries(oEntry.Index).Name
ActiveDocument.Tables(1).Rows.Last.Cells(1).Range.Text =
sAutoTextEntry
ActiveDocument.Tables(1).Rows.Last.Cells(2).Range.Select
Selection.Collapse
oEntry.Insert Where:=Selection.Range, RichText:=True
If oEntry.Index < iAutoTextCount Then
ActiveDocument.Tables(1).Rows.Add
End If
Next oEntry
Application.ScreenUpdating = True
Application.ScreenRefresh
End Sub
(That particular Add-In has 240+ AutoText entries.) Jay Freedman has a
corresponding template with code to load all of the items in a two-column
table into a template as AutoText.
Anyway, past my bedtime. Hope this gives you a start.