Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving Outlook Message
Message
De
12/03/2002 08:53:11
 
 
À
12/03/2002 00:26:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00631337
Message ID:
00631445
Vues:
26
Hi Rick.

I am wondering if anyone has found a method via outlook automation to move a message from the inbox to another folder?? If so, could you please let me know... pulling my hair on this one...

In addition to the advice you have already received about how the Message Indexes change as you move them, Keep in mind that you have to strore the result of the Move() to a variable. Otherwise Outlook (at least OL2K will) will give you back an OLE error telling you that the "Parameter is not optional".

So, code like this will work:
oInBox = oNameSpace.GetDefaultFolder( 6 )
*** This will work if you have a folder called YadaYada
oOtherFolder = oNameSpace.Folders( 1 ).Folders( "YadaYada" )
oMsg = oInBox.Items( 1 )
oCrap = oMsg.Move( oOtherFolder )
However, this syntax will give you the ole error:

oMsg.Move( oOtherFolder )

The point being that you must have oCrap for this to work (as I said before, at least in OL2K which is where I tested this)

HTH
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform