Smarttag recognizer

Add-in Express™ Support Service
That's what is more important than anything else

Smarttag recognizer
How to use the e.commitproc in VB 
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
I've seen the example shipped with addinexpress for a custom recognizer and i understand it.

The only thing is I work with VB and I cant get the commitproc working. It gives me an error "Property access must assign to the property to use its' value".

Any help is welcome.

Jacco

Here's the code:

Dim localText As String = e.Text.ToLower
Dim strlen As Integer
Dim i As Integer = 0
Dim WordList As ADXRecognizedWordCollection = SomeWordList
Dim word As String

Do While (i < WordList.Count)
word = CType(WordList(i), String).ToLower
Dim startpos As Integer
startpos = (localText.IndexOf(word) + 1)
strlen = word.Length

While (startpos > 0)
e.CommitProc(startpos, strlen)
If ((startpos + strlen) _
< localText.Length) Then
startpos = (localText.IndexOf(word, (startpos + strlen)) + 1)
Else
startpos = 0
End If

End While
i = (i + 1)
Loop

End Sub


Posted 07 Dec, 2005 11:02:49 Top
Sergey Grischenko


Add-in Express team


Posts: 7205
Joined: 2004-07-05
Hi Jacco.

Could you please change the code as shown below:

....
Dim CommitProc As AddinExpress.SmartTag.ADXSmartTagCommitProc_EventHandler
....

....
CommitProc = e.CommitProc
While (startpos > 0)
CommitProc(startpos, strlen)
....
End While
....
Posted 07 Dec, 2005 18:37:37 Top
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
Thank you, this works.

Jacco
Posted 08 Dec, 2005 00:44:45 Top