标题: 代码中的parent有什么用途,编译出错了?请教大家:) [打印本页] 作者: Coffey111111 时间: 2006-12-20 13:53 标题: 代码中的parent有什么用途,编译出错了?请教大家:) Dim a
Public Function CheckObjectDesription(parent, descr)
Dim oDesc
' Create description object
Set oDesc = Description.Create()
arProps = Split(descr, ",")
For i = 0 To UBound(arProps)
arProp = Split(arProps(i), ":=")
If UBound(arProp) = 1 Then
PropName = Trim(arProp(0))
PropValue = arProp(1)
oDesc(PropName).Value = PropValue
End If
Next
' Get all child objects with the given description
Set children = parent.ChildObjects(oDesc)
If children.Count = 1 Then
CheckObjectDesription = "Object Unique"
msgbox CheckObjectDesription
ElseIf children.Count = 0 Then
CheckObjectDesription = "Object Not Found"
msgbox CheckObjectDesription
Else
CheckObjectDesription = "Object Not Unique"
msgbox CheckObjectDesription
End If
End Function