Export attribute metadata with attachments

How do I walk through all attachments in an attachment type in an enterprise data dictionary?

I am trying to learn VBA and how to walk the object model hierarchy

Set dct = diag.EnterpriseDataDictionaries
    Set atchs = diag.EnterpriseDataDictionaries.Item("Magellan").AttachmentTypes.Item("Attribute Metadata").Attachments 
-- this does not work

2: atch1.Name -> (10606) Expecting a valid data type (eg. Integer).
2: -> (10551) Expecting a constant, var name or function name.
2: dct -> [[email protected]]
2: dct.count -> 1&
2: dct.item(1).AttachmentTypes -> [[email protected]]
2: dct.item(1).AttachmentTypes.count -> 4&
2: dct.item(1).AttachmentTypes.item(1).name -> "Attribute Metadata"
2: dct.item(1).AttachmentTypes.item(1) -> [[email protected]]
2: dct.item(1).AttachmentTypes.item(1).Attachments -> [[email protected]]
2: dct.item(1).AttachmentTypes.item(1).Attachments.item(1).name -> "Technical Trustee"
2: dct.item(1).AttachmentTypes.item(1).Attachments.count -> 22&

"Technical Trustee" is not in the "Attribute Metadata" attachment type

No Data
  • The below code will walk you through the list of attachments in an Enterprise Data Dictionary, much like you would see on the Data Dictionary tab in the UI.  If you are looking to walk through Bound Attachments, that's a whole different thing.

        Dim oEDD As Dictionary
        Dim oAttType As AttachmentType
        Dim oAttach As Attachment
        Set oEDD = oDiagram.EnterpriseDataDictionaries.Item("LC Enterprise Data Dictionary")
        For Each oAttType In oEDD.AttachmentTypes
            Debug.Print oAttType.Name
            For Each oAttach In oAttType.Attachments
                Debug.Print vbTab & oAttach.Name

No Data