CDO message.MoveTo 1 takes 1 argument error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

nHi,

I've writing a C# program that, amongst other things, moves an email message
from one folder to another.

Everything has been declared correctly and I have the id of the destination
folder, but when I call:

oMessageMoved=oMessage.MoveTo(objFolderDest.ID);

I get this error on compilation (VS 2003 -C#): No overload for method
'MoveTo' takes '1' arguments

I'm not overloading the method and am only passing a single argument.

Every example I've seen are in this format (i.e. 1 argument), but it just
won't compile. My PC has .NET v1.0.3705 and v1.1.4322, but I think it's
trying to compile against the earlier one. I'm also using CDO v.1.2.1.

PLease can you tell me if there is a way to tell which .NET compiler I'm
using, update it (if required) or fix the code.

Cheers,

Sandy
 
I've found the answer!

You have to provide two (2) arguments:
ID of destination folder,
ID of store - "" uses the default and works!!

So, oMessageMoved=oMessage.MoveTo(objFolderDest.ID,"");
does what is says on the tin.

Be aware that the message now drops out of the original collection and
messes up .GetNext() expectations.

Cheers,

Sandy
 
Back
Top