I am using the Groupwise 7 API and have come across a strange problem with query criteria.

The following criteria works perfectly

Set oMessages = oFolder.FindMessages("(MESSAGE CONTAINS ""10047"")")
but this line generates an error

Set oMessages = oFolder.FindMessages("(SUBJECT CONTAINS ""10047"")")
The error message is "An invalid argument was passed in the function call". Does anyone know why this happens? I have scoured the Developers Guide and "SUBJECT CONTAINS" is recognised as elligible for criteria. I also created a filter with 10047 in the subject field and then obtained the criteria GW used with the example in the Developers Guide, but this still didn't work.

Does anyone know what the problem is?