Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When will VFP7 SP1 come out?
Message
De
07/11/2001 05:01:44
 
 
À
05/11/2001 18:38:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00577318
Message ID:
00578395
Vues:
18
Jim:

>You could recode the FOR EACH in MoveToRetainedFolder to be a standard FOR loop, like this, and see if that makes the error go away:

It kinda does and it doesn't. It errors out initially, and if there are subsequent items in the collection it is processing, they seem to work OK. It bombs on the first item, OK with the rest?

I have attached a stripped down version of the method that populates the oColItemRefs property.
THIS.oColItemRefs = CREATEOBJECT('Collection')

LOCAL nMsgIndex, nNumMessages, cAttFile, nAttachNum, lErrorOccured

* Get the number of messages.
m.nNumMessages = THIS.oMail.ReadMail(,,,THIS.cExtractSender)

IF m.nNumMessages > 0
	* Set index to the oldest message.
	THIS.oMail.GetOldestMessage()
	* Run the following loop for the number of messages.
	FOR m.nMsgIndex = 1 TO m.nNumMessages
		* Record a reference to this mail item.
		THIS.oColItemRefs.ADD(THIS.oMail.oInbox.Items[this.oMail.nCurrentMessageNumber])

		* Process the next message (effectively: Skip -1).
		THIS.oMail.GetPreviousMessage()
	ENDFOR

	THIS.MoveToRetainedFolder(.T.)	&& Clears the collection.

ENDIF	&& m.nNumMessages > 0
The THIS.oColItemRefs object accesses a collection class so in essence, I am just adding a reference to all qualifying mail items in the Outlook INBOX to an array property (ITEM) hanging of the collection object. The process looks for messages in the inbox that have been received from a specific sender. The messages do have attachments that I process but, I have excluded this code here. When the attachment has been processed, then the only job left is the call the MoveToRetainedFolder method and move the processed items from the INBOX to a pre-defined retained messages folder. That is where it starts going pear-shaped. The For Next reads the mailitem's object reference from the THIS.oColItemRefs.item[] collection and simply tries to execute the item's move method with the retained folder object as the move method's argument.

The exact error I am receiving is as follows :-

Error #1426 in Movetoretainedfolder line 530
"m.oItem.MOVE(m.oRetained)"
OLE error code 0x8002000f: Parameter not optional.

Call Stack:
5 Hmlagentextractmanager.Movetoretainedfolder (source\hmexmngr.fxp)
4 Hmlagentextractmanager.Problemdomain (source\hmexmngr.fxp)
3 Hmlagentextractmanager.Main (source\hmexmngr.fxp)
2 _0iu0l9qk5.Lurkcallprocesses (source\frmlurks.sct)
1 _0iu0l9qk5.Tmrtimer1.Timer (source\frmlurks.sct)

Any thoughts on this now Jim?

-Gary
-=Gary
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform