Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Move emails to subfolder of Inbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Divers
Thread ID:
01543055
Message ID:
01543230
Vues:
68
This message has been marked as the solution to the initial question of the thread.
I solved it eventually, here with the code in case anyone else needs it:
#include include\XLcons.h

oOutLookObject = Createobject('Outlook.Application')
olNameSpace = oOutLookObject.GetNameSpace('MAPI')
loInbox=olNameSpace.GetDefaultFolder(olFolderInbox)

loNewFolder = loInbox.folders("Euro")

create cursor curList (item c(40),att c(40))

for i = loInbox.Items.Count to 1 step -1                           &&Loops through all the inbox messages
	myItem = loInbox.Items(i)
	
	if myItem.Attachments.Count > 0 
		for myAttached= 1 TO myItem.Attachments.Count    && Loops through all attachments
			lcFilename = upper(myItem.attachments.Item(myAttached).filename)
			insert into curList (item,att) values (myItem.Subject,lcFilename)
			if myItem.Subject=[Euro]
				 =myItem.move(loNewFolder)
			endif
		endfor
	endif
endfor
Kevin Delaney
Financial Systems Manager
CPL Solutions Ltd

83 Merrion Square, Dublin 2, Ireland.
e: kevin.delaney@cpl.ie w: www.cpl.ie
p: +353 1 482-5368
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform