Public Function SetExist(ByVal vDraw As Variant, ByVal sSet As String) As Boolean
Dim I As Integer, J As Integer
SetExist = False
If vDraw Is Nothing Then Exit Function
For I = 0 To vDraw.SelectionSets.Count – 1
If vDraw.SelectionSets.Item(I).Name = sSet Then SetExist = True
Next I
End Function
Public Function DictionaryExist(ByVal vDraw As Variant, ByVal sDict As String) As Boolean
Dim I As Integer, J As Integer
On Error GoTo ERR_NO_KEY
DictionaryExist = False
If vDraw Is Nothing Then Exit Function
Set oDictionary = vDraw.Dictionaries.Item(sDict) ‘试错
DictionaryExist = True
On Error GoTo 0
Exit Function
ERR_NO_KEY: ‘primary key
DictionaryExist = False
On Error GoTo 0
End Function
Public Function AppExist(ByVal vDraw As Variant, ByVal sApp As String, ByVal sDict As String) As Boolean
Dim I As Integer, J As Integer
AppExist = False
If vDraw Is Nothing Then Exit Function
If Not DictionaryExist(oDraw, sDict) Then Exit Function
Set oDictionary = vDraw.Dictionaries.Item(sDict)
Dim XTypeOut As Variant
Dim XValueOut As Variant
oDictionary.GetXData “”, XTypeOut, XValueOut
If Not IsArray(XTypeOut) Then Exit Function
If Not IsArray(XValueOut) Then Exit Function
For I = LBound(XTypeOut) To UBound(XTypeOut)
If XTypeOut(I) = 1001 And XValueOut(I) = sApp Then
AppExist = True
End If
Next I
End Function