The method EA.Repository.GetElementSet(query, 2)
returns an EA.Collection
with items of type EA.Element
. It does so based upon the Object_ID returned by your query. All other returned values are ignored.
These objects don't have a Value
property.
What you seem to be looking for, is value of the tagged values with name "RTFTemplate" defined on the element.
You can do that in two ways
Iterate the tagged values of the elements returned by GetElementSet
Something like this (vbscript)
for each element in all_modeldocs
elem_name = element.Name
for each tag in element.TaggedValues
if tag.Name = "RTFTemplate" then
elem_value : tag.Value
end if
next
next
Use Repository.SQLQuery and parse the resulting xml string
Something like this (vbscript)
function getArrayListFromQuery(sqlQuery)
dim xmlResult
xmlResult = Repository.SQLQuery(sqlQuery)
set getArrayListFromQuery = convertQueryResultToArrayList(xmlResult)
end function
Function convertQueryResultToArrayList(xmlQueryResult)
Dim result
set result = CreateObject("System.Collections.ArrayList")
Dim xDoc
Set xDoc = CreateObject( "MSXML2.DOMDocument" )
'load the resultset in the xml document
If xDoc.LoadXML(xmlQueryResult) Then
'select the rows
Dim rowList
Set rowList = xDoc.SelectNodes("//Row")
Dim rowNode
Dim fieldNode
'loop rows and find fields
For Each rowNode In rowList
dim rowArrayList
set rowArrayList = CreateObject("System.Collections.ArrayList")
'loop the field nodes
For Each fieldNode In rowNode.ChildNodes
'add the contents
rowArrayList.Add fieldNode.Text
Next
'add the row the the general list
result.Add rowArrayList
Next
end if
set convertQueryResultToArrayList = result
end function
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…