Information générale
Catégorie:
Applications Internet
Titre:
Deleting Items in Outlook
Hey--
I'm trying to write a program that will go through users email accounts (Microsoft Outlook) and delete messages from the Inbox and Deleted Items folders. So far, I have written this code:
loapp=CREATEOBJ('Outlook.Application')
loSpace=loapp.getnamespace('MAPI')
mmailbox="Mailbox - "+ALLT(GETE('name')) &&the way that we access specific users accounts
loInbox=loSpace.GetDefaultFolder(6)
mdelete=MESSAGEBOX("Do you want to delete the messages in the Inbox?",292)
DO CASE
CASE mdelete=6
FOR EACH item in loInbox.items
item.delete()
ENDFOR
CASE mdelete=7
ENDCASE
which does go through the inbox and begins to delete messages, but it doesn't delete all of them, it always leaves 2 or 3. Just wondering if there is some hole in this code that is causing that and if there is a delete all option or something of the sort for Outlook in VFP.
Thanks
Kent Floros
Ripon Community Printers
Suivant
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