Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving Outlook Message
Message
From
12/03/2002 08:53:11
 
 
To
12/03/2002 00:26:18
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00631337
Message ID:
00631445
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform