Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Outlook Automation
Message
From
17/07/2008 10:17:46
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01331517
Message ID:
01331972
Views:
15
That worked but now I have one last problem to overcome. I'm looping through the rules I have setup and checking the e-mails located in the inbox against these rules and then moving them to the assigned personal folder. The problem is when I move an email to a personal folder it changes the number of items in the inbox and for some reason causes the loop to end before all the emails have been looped through. I've also tried looping by referencing the email item by index but when you remove an item from the inbox the index number for the remaining emails change as well and you end up referencing an email index that no longer exists resulting in an "Out of Bounds" error. I'm probably not explaining the issue very well so please let me know if you need any further info.

Example of loop I'm using:
loApp    = CREATEOBJECT("Outlook.Application")
loSpace  = loApp.GetNameSpace("MAPI")

loSent = loSpace.GetDefaultFolder(5)

oItems = loSpace.GetDefaultFolder(5).Items

FOR EACH loItem IN oItems
	
	= loitem.Move(loSpace.Folders(snt_pst).Folders(snt_fldr))
	
NEXT
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform