Private Sub RichTextBox1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim sLoc As Integer
Dim eLoc As Integer
Dim wrds() As String
Dim tmp() As String
Dim i As Integer
If Button = 2 Then
If Trim(RichTextBox1.SelText) = "" Then
If RichTextBox1.SelStart = 0 Then Exit Sub
sLoc = InStrRev(RichTextBox1.Text, " ", RichTextBox1.SelStart)
eLoc = InStr(RichTextBox1.SelStart, RichTextBox1.Text, " ") - 1
RichTextBox1.SelStart = sLoc
RichTextBox1.SelLength = eLoc - sLoc '+ 1
End If
If Trim(RichTextBox1.SelText) <> "" Then
For x = mnuWord.UBound To 1 Step -1
Unload mnuWord(x)
Next
mnuWord(0).Caption = "NOT FOUND"
For x = 0 To UBound(WORDLIST)
tmp = Split(WORDLIST(x), ":")
If tmp(0) = Trim(RichTextBox1.SelText) Then
wrds = Split(tmp(1), ";")
For i = 0 To UBound(wrds)
If i = 0 Then
mnuWord(0).Caption = wrds(i)
Else
Load mnuWord(i)
mnuWord(i).Visible = True
mnuWord(i).Caption = wrds(i)
End If
Next
End If
Next
PopupMenu mnuPop
End If
End If
End Sub