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
|
|
Sergey Grischenko
Add-in Express team
Posts: 7235
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
.... |
|
Jacco van der Pol
Posts: 30
Joined: 2005-09-13
|
Thank you, this works.
Jacco |
|