> >You could use a RTFbox instead. Rightclick left toolbar ->
Components... ->
Check "Microsoft Rich Text Box" -> OK
Althougth you would have thought you could just substitute one for the
other, the RTF seems to screw up the instr function. - Or at least get
different values from the original txtbox. Can anyone shed anylight on
this confusion?
It should work as expected on the Text property (as opposed to the
TextRTF property). On the other hand, InStr isn't really needed since
the RichTextBox provides a Find method that you can use which, if set
to, can automatically highlight the text being searched for. In
addition, the Find method can be set to look for whole word matches as
opposed to mere text matches (this lets you find all of the "the" words
without finding it in the middle of "mother" or "father" for example).
And, also in addition, it can be set to search between a start and end
position within the file, so you can narrow your search to a specific
area of the text if desired. You should check it out in the help files.
Rick - MVP