Programmatically entering the sent date/time into a user defined field in Outlook contacts

We need to export the "sent" date/time on a contact.  This is the TRUE creation date of the contact; we recently went through an Exchange migration and the created date/time is from when we migrated the data over.

We can't export this through the traditional export function in Outlook as the sent field isn't there.  I also tried copy/paste from Outlook directly in to Excel, and while this works, it breaks many of the contacts up to a second line (I see this even when I copy/paste into notepad, so it's not a delimiter type issue.)

My thought is to use a VBA to grab the sent date and drop it in the user1 field for each contact, since that is exportable.  But I don't know the first thing for generating that code.  I did some digging, but not turning up much useful info.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexei KuznetsovMicrosoft Outlook MVPCommented:
Ok, this is easy:
Sub CopySentToUser1()
    On Error Resume Next
    For Each Item In ActiveExplorer.Selection
        Item.User1 = Format(Item.PropertyAccessor.GetProperty("urn:schemas:httpmail:date"), "General Date", 0, 0)
End Sub

Open in new window

Just select the required contacts in Outlook and run this macro.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
diperspAuthor Commented:
Perfect, I figured it was easy, just couldn't figure out what I needed to do.  Thanks!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.