Topic
  • 4 replies
  • Latest Post - ‏2012-04-24T20:10:06Z by SystemAdmin
SystemAdmin
SystemAdmin
1061 Posts

Pinned topic Data Type of "Reference Documents" property?

‏2012-04-23T13:49:43Z |
Is the "Reference Documents" property a Collection? I am trying to print out the reference document url(s) for an object through a Macro, but am not figuring that out.
Updated on 2012-04-24T20:10:06Z at 2012-04-24T20:10:06Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    1061 Posts

    Re: Data Type of "Reference Documents" property?

    ‏2012-04-23T14:57:49Z  
    I'm currently trying to access by defining the following:
    Dim myDEF as Definition
    Dim myREFS as OfCollection
    Dim myREF as string

    myREFS = myDEF.GetPropertyAsCollection("Reference Documents")
    myREF = myREFS.Item(1)
    I get an error:
    myDEF.GetPropertyAsCollection("Reference Documents")
    "Property must be minispec or OF Collection"
  • RobertoFdez
    RobertoFdez
    102 Posts

    Re: Data Type of "Reference Documents" property?

    ‏2012-04-24T08:29:24Z  
    I'm currently trying to access by defining the following:
    Dim myDEF as Definition
    Dim myREFS as OfCollection
    Dim myREF as string

    myREFS = myDEF.GetPropertyAsCollection("Reference Documents")
    myREF = myREFS.Item(1)
    I get an error:
    myDEF.GetPropertyAsCollection("Reference Documents")
    "Property must be minispec or OF Collection"
    I think that property is String.
  • ArifH
    ArifH
    30 Posts

    Re: Data Type of "Reference Documents" property?

    ‏2012-04-24T15:29:10Z  
    I think that property is String.
    It is String.

    If you have more than one item and the output is not to your liking, you can find out where to split the string by using inStr.
    InStr(1, SearchString, vbCrLf) will return the position of the first line break character.
  • SystemAdmin
    SystemAdmin
    1061 Posts

    Re: Data Type of "Reference Documents" property?

    ‏2012-04-24T20:10:06Z  
    I'm currently trying to access by defining the following:
    Dim myDEF as Definition
    Dim myREFS as OfCollection
    Dim myREF as string

    myREFS = myDEF.GetPropertyAsCollection("Reference Documents")
    myREF = myREFS.Item(1)
    I get an error:
    myDEF.GetPropertyAsCollection("Reference Documents")
    "Property must be minispec or OF Collection"
    You're right - it is a string, and instead of a collection of objects, I have to use the following:

    address_string = myDEF.GetProperty("Reference Documents")

    At least there is a line break inbetween links and it could be parsed out.

    It would be better if SA could treat each hyperlink as a seperate Information (DM2) object (for the DoDAF folks) or other 'kinds' of information objects (e.g., SOP, Control, Support Doc, etc). If these were objects, we could use the ONEOF or LISTOF in the property definition.

    Thanks guys!