GetTag
Renvoie l'identifiant de l'étiquette attribuée au champ du tableau.
Compatibilité
Proposé dès IDEA version 12.0
Syntaxe
GetTag(fieldName As String) As String
Paramètres
fieldName
Nom du champ du tableau (non sensible à la casse).
Valeur retournée
Renvoie l'identifiant de l'étiquette attribuée au champ du tableau (chaîne).
Si aucune étiquette n'est attribuée au champ, une chaîne vide est renvoyée.
Si aucun champ avec le nom indiqué n'existe, une exception est déclenchée.
Remarques
Plusieurs étiquettes peuvent être attribuées à un champ du tableau. La méthode GetTag() renvoie seulement le premier identifiant d'étiquette trouvé. Cette méthode doit donc être utilisée avec précaution.
Exemple
Sub Main()
Dim ac As Object
Dim tagging As Object
Set ac = CreateObject("SmartAnalyzer.AutomationClient")
Set tagging = ac.GetTagging("Sample-Weblog")
tagId = Tagging.GetTag("SITE")
If Len(tagId) = 0 THEN
MsgBox"No tag is assigned to field 'SITE'"
ELSE
MsgBox"Tag '" + tagId + "' is assigned to field 'SITE'"
END IF
on error Resume next
tagId = Tagging.GetTag("INVALID_FIELD_NAME")
MsgBox"Error: " + CStr(Err.Number) + "'; Desc: '" + Err.Description
End Sub