Convert a MailItem to a ContactItem

C

Craig Buchanan

I am trying to convert a MailItem to a ContactItem programatically. I do
this by copying the MailItem, then moving the copy to the Contacts folder.
While lthe Move() method creates a new Contact in the Contacts folder, it
also leaves the copy of the message in the Inbox.

Here's the code:

'copy the mailItem
Dim copyOfMailItem As Outlook.MailItem = mailItem.Copy

'move the mailItem to the Contacts folder, which creates a contact
'it also calls Save() on itself implicitly
copyOfMailItem.Move([Contacts folder])

'destroy copy and release reference
copyOfMailItem = Nothing

What am I missing? Thoughts are appreciated. Thanks.
 
B

Brian Tillman [MVP - Outlook]

I am trying to convert a MailItem to a ContactItem programatically. I do
this by copying the MailItem, then moving the copy to the Contacts folder.
While lthe Move() method creates a new Contact in the Contacts folder, it
also leaves the copy of the message in the Inbox.

Here's the code:

Ask in the coding newsgroup microsoft.public.outlook.program_vba
 

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