How can I add a new user defined field for contacts using an add-in in Outlook 2000 ?

K

kia

Hi,

I want to add a new user defined field for a contact using an add-in. Is
this possible ?

If this is possible how can I enter a value using the same add-in. I used
until now the following code to add a new contact:

CComQIPtr <Outlook::_Application> spApp(m_spApp);
ATLASSERT(spApp);

CComPtr<Outlook::_ContactItem> spContactItem;

spApp->CreateItem( olContactItem, (IDispatch**)&spContactItem );
spContactItem->put_FirstName( OLESTR("Smith") );
spContactItem->put_LastName( OLESTR("John") );
spContactItem->Save();

Thanks
 
K

kia

thanks,

I managed to add the field but how can I add a value in this field
programatically.
 
D

Dmitry Streblechenko \(MVP\)

set UserProp = MailItem.UserProperties.Add(...)
UserProp.Value = "some value"

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

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