Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading the subject of the messages in the inbox
Message
De
14/03/2003 14:59:32
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00765985
Message ID:
00765997
Vues:
27
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform