Get a list of projects linked to a template
Function ShowLinkedProjects (ByRef tdc As TDConnection)

' Get a list of projects linked to a template

    Dim aStatus, msg
    Set aStatus = tdc.PolicyStatus
    msg = ""

    If (aStatus.IsTemplate) Then

        Dim tplMgr
        Set tplMgr = tdc.TemplateManager

        Dim ProjectList
        Set ProjectList = tplMgr.LinkedProjects
        
        Dim i%
        If (ProjectList.Count > 0) Then
            For i = 1 To ProjectList.Count
                Dim prj
                Set prj = ProjectList.Item(i)
                msg = msg & i & ") [" & prj.DomainName & "].[" & prj.Name & "]" & Chr(13)
            Next
        Else
            msg = "No linked projects."
        End If

    Else
        msg = "Not a Template!!!"
    End If

    MsgBox msg, 0, "Show Linked Projects"

End Function