Understand that I’m looking for the string “test”. Looks like the result 0 has something todo with some beta code of GroupWise SP2 I’m running.

If I understand correctly the sample code you provided should displays the number of messages found.
(the result should be a number?, right?

How can you display the actual messages.