Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reading the subject of the messages in the inbox
Message
From
14/03/2003 14:59:32
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00765985
Message ID:
00765997
Views:
28
>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
Map
View

Click here to load this message in the networking platform