Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Move emails to subfolder of Inbox
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01543055
Message ID:
01543230
Views:
67
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
Previous
Reply
Map
View

Click here to load this message in the networking platform