PC Review


Reply
Thread Tools Rate Thread

Convert a MailItem to a ContactItem

 
 
Craig Buchanan
Guest
Posts: n/a
 
      22nd Oct 2008
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.

 
Reply With Quote
 
 
 
 
Brian Tillman [MVP - Outlook]
Guest
Posts: n/a
 
      23rd Oct 2008
"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:F04D896C-A8E8-4C78-94E1-(E-Mail Removed)...

>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
--
Brian Tillman [MVP-Outlook]

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Outlook MailItem to PostItem Pavan Microsoft Outlook VBA Programming 0 31st Jul 2006 07:40 AM
How can I create a MailItem that displays like a received MailItem ? Clive Microsoft Outlook Form Programming 0 27th Feb 2006 04:14 PM
How to convert Redemption.MessageItem to Outlook.MailItem Denis Lavrenko via OfficeKB.com Microsoft Outlook VBA Programming 1 18th Apr 2005 06:48 PM
Convert the forwarded message to MailItem Denis Lavrenko via OfficeKB.com Microsoft Outlook VBA Programming 2 24th Mar 2005 05:22 AM
Convert from System.IO.MemoryStream to Outlook.MailItem? =?Utf-8?B?QXJpbGQ=?= Microsoft Outlook Form Programming 0 30th Jan 2004 12:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:46 PM.