Dim t As MLeader = trans.GetObject(oid, OpenMode.ForRead)
If t.HasContent Then
Select Case t.ContentType
Case ContentType.MTextContent
'strange, has mtext, but mtext is not in db
'Dim mt As MText = trans.GetObject(t.MText.ObjectId, OpenMode.ForRead)
If t.MText.Text.Length > 2 Then (..do your things...)
Case ContentType.BlockContent
'blocktablerecord?
Dim btrb As BlockTableRecord = trans.GetObject(t.BlockContentId, OpenMode.ForRead)
For Each oho As ObjectId In btrb
Dim oclass = oho.ObjectClass.DxfName
If oclass = "ATTDEF" Then
Dim attd As AttributeDefinition = trans.GetObject(oho, OpenMode.ForRead)
Dim attr As AttributeReference = t.GetBlockAttribute(oho) '(and do your things with attr)
End If
Next
End Select
End If