function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ron HessRon Hess 

Simple -> ISmartTagRecognizer_Recognize

With the new url format my simple smart tags dll just got smarter (after I tweaked the patern)

now works for many entities

here is the code for the recognizer, the rest I got from the samples in the smart tags resource kit

it matches anything with 15 chars starting with 00, simple but i've found it handy when staring at spreadsheets full of account ID's

-----------------------------------------
Public Sub ISmartTagRecognizer_Recognize(ByVal Text As String, _
    ByVal DataType As SmartTagLib.IF_TYPE, ByVal LocaleID As Long, _
    ByVal RecognizerSite As SmartTagLib.ISmartTagRecognizerSite)
   
    Dim regEx, Match, Matches   ' Create variable.
    Set regEx = New RegExp   ' Create a regular expression.
    regEx.Pattern = "00............."   ' Set pattern, this is for accounts and oppo and ?
    regEx.IgnoreCase = False ' case sensitivity.
    regEx.Global = True   ' Set global applicability.
    Set Matches = regEx.Execute(Text)   ' Execute search.
    Dim index As Integer, termlen As Integer
    Dim propbag As SmartTagLib.ISmartTagProperties
    For Each Match In Matches   ' Iterate Matches collection.
        index = InStr(Text, Match)
        termlen = 15
        Set propbag = RecognizerSite.GetNewPropertyBag
        RecognizerSite.CommitSmartTag _
            "schemas-neoforma-com/neofsalesforce#oppo", _
            index, termlen, propbag
   Next
done:
End Sub

Ron HessRon Hess

You will need this also, to keep it simple (too simple) this has a hardcoded server, you may want to change/ enhance this..

--------------------------

Public Sub ISmartTagAction_InvokeVerb(ByVal VerbID As Long, ByVal ApplicationName As String, ByVal Target As Object, ByVal Properties As SmartTagLib.ISmartTagProperties, ByVal Text As String, ByVal XML As String)
    ' Invokes the appropriate action when a user clicks on
    ' an action displayed on the smart tag UI which corresponds
    ' to the VerbCaptionFromID value.
    Dim ie
    If (VerbID = 1) Then
        Set ie = CreateObject("InternetExplorer.Application")
        ie.Navigate ("https://ssl.salesforce.com/" + _
            Text)
        ie.Visible = True
    End If
End Sub