标题: 利用Mercury.ObjectRepositoryUtil遍历对象库对象,出现,stopped working [打印本页] 作者: lixudong3032 时间: 2011-9-29 11:37 标题: 利用Mercury.ObjectRepositoryUtil遍历对象库对象,出现,stopped working 创建vbs脚本如下:
on error resume next
Dim ImageObj, PageObj, RepositoryFrom, RepositoryTo
Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")
tsrPath="c:\查询.tsr"
RepositoryFrom.Load tsrPath
call EnumerateAllChildProperties(Root)
Set RepositoryFrom =nothing
msgbox "lixudong"
Function EnumerateAllChildProperties(Root)
Dim TOCollection, TestObject,Msg
Set TOCollection = RepositoryFrom.GetChildren(Root)
For i = 0 To TOCollection.Count - 1
Set TestObject = TOCollection.Item(i)
Msg = RepositoryFrom.GetLogicalName(TestObject) & vbNewLine
msgbox Msg
Set TestObject=nothing
Next
Set TOCollection=nothing
End Function