Information générale
Catégorie:
COM/DCOM et 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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement