#7105
MA
Participant

Select a GroupWise folder and try the following code. Hope this helps.

‘————————————————————-
Sub Main(Client, GWEvent)

dim oFolder
dim oMessages

‘ Get the selected folder
set oFolder = nothing
set oFolder = Client.ClientState.SelectedFolder

if oFolder is nothing then
exit sub
end if

msgbox “Selected folder: ” & oFolder.name

set oMessages = nothing
set oMessages = oFolder.messages.find(“(MAIL) AND (BOX_TYPE=INCOMING) AND (NOT READ)”)

if oMessages is nothing then
exit sub
end if

for each oMsg in oMessages
msgbox “From: ” & oMsg.fromtext & vbcrlf &_
“Subject: ” & oMsg.Subject & vbcrlf &_
“Creation Date: ” & oMsg.CreationDate
next

set oMessages = nothing
set oFolder = nothing

End Sub
‘————————————————————-