Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting Items in Outlook
Message
From
06/08/2001 15:29:40
 
 
To
06/08/2001 15:14:14
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00540334
Message ID:
00540341
Views:
18
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform