Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dir comm for Outlook Express
Message
 
To
03/06/2003 11:51:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00791744
Message ID:
00795781
Views:
18
I have switched to using Outlook, now.
Might you possibly know how to delete messages with automation in Outlook?

I have gotten this far, using this line to delete messages

loEmail.Delete && if you want to !!

But the results are uneven. The program will delete some of the items
but then stop and give an error message

ole idispatch exception code 4096 from outlook: array out of bounds

Can't figure out why?
Steve

clear
CREATE CURSOR Temp (AddDate T,Sender C(40),Subject C(100),Notes M,To C(40),Address C(40),ToAddress C(40))
LOCAL loOutlook,loNS,loInbox,lnFolder,loInboxItems,lnCount,lnCompteur,loEmail
LOCAL lcAddress,loReply,llOk

loOutlook = CREATEOBJECT('Outlook.Application')
loNS = loOutlook.GetNameSpace('MAPI')
loInbox = loNS.GetDefaultFolder(6)

FullCount= loInbox.Items.Count

? FullCount
wait

FOR x = 1 TO FullCount
loInboxItems = loInbox.Items
loEmail = loInboxItems.Item(x)
loEmail.Delete
NEXT
browse width 10
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform