HI, this is a VB6 code but you can easily translate in 4GL by replacing . by : where there are properties/methods references.
In 2 words, create an object wich point to the MAPI namespace, an other for the folder you want to examine (inbox in your case) and scan the Items list.
Hope it helps...