Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting Items in Outlook
Message
De
06/08/2001 15:29:40
 
 
À
06/08/2001 15:14:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00540334
Message ID:
00540341
Vues:
17
Since For Each loops through the existing objects, if you remove these objects as you loop, you end up skipping objects. Like the ol' "release all open forms" problem.

I'd do the bold stuff below instead.
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
          Do While loInbox.Items.Count>0
               loInbox.Items(1).Delete()
          EndDo
     CASE mdelete=7
ENDCASE
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform