in reply to Re: Re: moving emails between folders with Win32::OLE
in thread moving emails between folders with Win32::OLE

Sorry, was my error. MoveTo requires the FolderID or StoreID as String. http://msdn.microsoft.com/ -> search for CDO and MoveTo says about the following:
$item->MoveTo( $Folder5->{FolderID} );
or:
$item->MoveTo( $Folder5->{StoreID} );

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Replies are listed 'Best First'.
Re: Re: Re: Re: moving emails between folders with Win32::OLE
by RayRay459 (Pilgrim) on May 14, 2002 at 16:50 UTC
    I'm having a problem identifying the store id.. I found this link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_olemsg_moveto_method_folder_object_.asp and even with this :
    $item->{MoveTo}( $Folder5 ); i get this error Win32::OLE(0.1501) error 0x8002000e: "Invalid number of parameters" in METHOD/PROPERTYGET "MoveTo" at C:\scripts\perl\email\getSearchE +mail.pl li ne 27 with this line: $item->MoveTo( $Folder5); i get Win32::OLE(0.1501) error 0x80020006: "Unknown name" in GetIDsOfNames of "MoveTo" at C:\scripts\perl\email\getSearchEm +ail.pl lin e 27
    still can't seem to find the right line to make the current item in my loop move to another folder. Anything else i can try? Thnx, Ray
Re: Re: Re: Re: moving emails between folders with Win32::OLE
by RayRay459 (Pilgrim) on May 14, 2002 at 17:40 UTC
    I'm having trouble figuring out what the storeid is. i looked at the page http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/_olemsg_folder_object.asp
    and i can't seem to get a grip on how that would work in my code. I must be missing something in this line that makes it think that it doesn't have the right number of parameters. i'm getting errors that say :
    Win32::OLE(0.1501) error 0x8002000e: "Invalid number of parameters" in METHOD/PROPERTYGET "MoveTo" at C:\scripts\perl\email\getSearchE +mail.pl li ne 27
    with the line :
    $item->{MoveTo}( $Folder5 );
    <banging head against my desk> i wish i could make this work. Can anyone help? Thanks again Strat for your postings. I do appreciate your help. Ray
      Perhaps not the fastest reply but since I had the same problem and searching I ended up on this node...
      I got it working with;
      $item->Move($Folder5);