General information
Category:
COM/DCOM and OLE Automation
>I need a very simple, if u can call it that, rutine to read all the messages in the inbox of Outlook and read for a string contained in the subject and then delete the message according to a condition, is it that possible?
>
>thks
This is untested, but should give you the idea:
oOutlook=CreateObject("Outlook.Application")
oNS = oOutlook.GetNameSpace("MAPI")
oInbox = oNS.GetDefaultFolder(6)
oMailItems = oInbox.Items
FOR nItem = oMailItems.Count TO 1 STEP -1
oItem = oMailItems[nItem]
IF cTheString$oItem.Subject
oItem.Delete
ENDIF
ENDFOR
If you only expect to find it once, you may be able to use the Find method or the Restrict.
Tamar
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only