Christopher Greaves |
|||
Christopher Greaves |
|||
If you are interested in applications please visit www.VBASolutions.ca .
If you are interested in end-user macros please visit www.TorontoMacros.com .
We know that the List galleries identify only 3x7=21 of the List Templates.
A function to return the index of a Named List Template in the appliaction’s List gallery is of no practical use.
We need a function to return the index of a Named List Template within a document.
Public Function lngLocateNamedListTemplateInDocument(doc As Document, strName As String) As LonglngLocateNamedListTemplateInDocument = -1 ' default result is failure
Dim lng As Long
For lng = 1 To doc.ListTemplates.Count
If doc.ListTemplates(lng).Name = strName Then
lngLocateNamedListTemplateInDocument = lng
Exit For
Else
End If
Next lng
'Sub TESTlngLocateNamedListTemplateInDocument()
' MsgBox lngLocateNamedListTemplateInDocument(ActiveDocument, "_Bullet")
'End Sub
End Function