Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / May 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kia - 21 May 2004 12:40 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.