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
Dmitry Streblechenko \(MVP\) - 22 May 2004 19:24 GMT
See ContactItem.UserProperties collection.
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
> Hi,
>
[quoted text clipped - 15 lines]
>
> Thanks
kia - 24 May 2004 09:57 GMT
thanks,
I managed to add the field but how can I add a value in this field
programatically.
> See ContactItem.UserProperties collection.
>
[quoted text clipped - 22 lines]
> >
> > Thanks
Dmitry Streblechenko \(MVP\) - 24 May 2004 23:35 GMT
set UserProp = MailItem.UserProperties.Add(...)
UserProp.Value = "some value"
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
> thanks,
>
[quoted text clipped - 28 lines]
> > >
> > > Thanks