Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Email Messages: Move vs. Copy 1

Status
Not open for further replies.
Mar 26, 2009
2
US
In Outlook, I want to copy messages from my Drafts folder to my Outbox folder. Best case, I want to copy 2 of the 3 messages in the Drafts folder, and rename them.

This is what I don't understand...

This works:
Code:
For Each item In Drafts.Items
    item.Move Outbox
Next item

This doesn't:
Code:
For Each item In Drafts.Items
    item.Copy Outbox
Next item

I get a Run-time error '450':
Wrong number of arguments or invalid property assignment.

I'm confused.

Thanks,
Jeremy
 
What about this ?
Code:
For Each item In Drafts.Items
    Set myCopiedItem = item.Copy
    myCopiedItem.Move Outbox
Next item

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
AFAIK, PHV is correct. You must SET each item as a new object - PHV's myCopiedItem (which of course should be declared...) - and then move that object.

BTW: I do not think
Code:
myCopiedItem.Move Outbox
will work though. It does not work for me. The destination folder Outbox has to be fully qualified.

Gerry
 

Thank you. It worked!

Fumei - Outbox was qualified as follows:

Code:
Dim Outbox As MAPIFolder
Set ns = GetNamespace("MAPI")
Set Outbox = ns.GetDefaultFolder(olFolderOutbox)

How can this thread be closed?

 
That was how I had to qualify it. This may perhaps be a demonstration of why it is a good idea to NOT use names that are the same (or similar) to names used internally. How was I to know you had previously properly declared an object "Outbox"?

There is no "Solved" marker, or a way to "close" the thread.

If you feel PHV has helped, you may want to consider showing appreciation with a star. This shows your appreciation, and also acts as a possible indication to others that the thread may be useful.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top