CasewareDocs

GetTag

Returns the ID of the tag assigned to the table field.

Compatibility

Available as of IDEA version 12.0

Syntax

GetTag(fieldName As String) As String

Parameters

fieldName

Name of the table field (case insensitive).

Return Value

Returns the ID of the tag assigned to the table field (string).

If no tag is assigned to the field, an empty string is returned.

If no field with the given name exists, an exception is thrown.

Remarks

Multiple tags might be assigned to table field. The method GetTag () returns only the first tag ID found. Therefore, this method should be used with care.

Example

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