Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email receive
Message
From
01/01/2008 12:21:01
 
 
To
01/01/2008 08:43:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01278474
Message ID:
01278814
Views:
16
* Count messages in Inbox
Contagem = inbox.Items.Count


The inbox can contain either e-mail messages or other folders.

So I would usew code like this to process the items in the Inbox:
*** Get a local referenece to the collection of of items in the Inbox
loItems = loInbox.Items

*** Process all the items in the inbox
*** If it is a mail item, save it and process the attachments
IF VARTYPE( loItems ) = 'O'
  FOR EACH loItem IN loItems
    IF loItem.Class = 43 && olMail	
      *** Process the message and the attachments
    ENDIF
  ENDFOR
ENDIF
* Move the complete message to deleted items
* remember that object 'eliminados' is an instance to
* 'deleted items' folder
mensagem.Move(eliminados)


This has the effect of making the count of the items collection less than your loop limit ( contagem ). I would expect an Error 1234: Subscript is outside defined range.
loRootFolder = oNameSpace.GetDefaultFolder( 6 ) && Inbox
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform