problem e-mail item moving

P

PeterQ

hello Team !

I am trying to move an e-mail item from one folder to another:


omItem and cpyItem are of type MailItem
X and Y are assumed Folder names

CODE:

omItem.FlagStatus = olFlagComplete
omItem.Save

'THIS LINE WORKS WELL:
Set cpyItem = Application.ActiveInspector.CurrentItem
'THIS LINE GIVES ERROR, SAYING I CANNOT MOVE NON-SENT ITEMS
cpyItem.Move m_oMailbox.Folders.Item("X").Folders.Item("Y")

I am looking for a nice solution or work-around to solve this problem.

Please, is there anyone who can help me ?





*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Sue Mosher [MVP-Outlook]

I think the message means what it says. Why are you trying to move an unsent
MailItem?
 
K

Ken Slovak - [MVP - Outlook]

Move is a function that returns a new item, so set the return value to a new
item. Also, close the open item before you try to move it. Save the open
item so you have an EntryID, get that EntryID and use
NameSpace.GetItemFromID to retrieve it again and then do the move. See if
that works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top