Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dir comm for Outlook Express
Message
 
À
03/06/2003 11:51:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00791744
Message ID:
00795781
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform