And I forgot to mention that you also have to type cast the function, i.e. Public Function CheckWord(RTFName As RichTextBox) As SOMETHING
Also, after looking into the matter, I realize that your original declaration (plus the cast) will work. I wrote a quick test with CheckWord returning the contents of RTFName.Text.
I tried leaving the "As String" off to see if it would cause the error. No error, but also no returned string. Maybe this will still give you something to try.Code:Private Sub Command1_Click() Text1.Text = CheckWord(RichTextBox1) End Sub Private Function CheckWord(RTFName As RichTextBox) As String CheckWord = RTFName.Text End Function




Reply With Quote