[Outlook]add contact item

  • Thread starter Thread starter Marcel Stör
  • Start date Start date
M

Marcel Stör

Hi folks

Does anyone know how to add an object of type ContactItem to an _Items list?
_Items provides an add() method which, however, only accepts a Variant as
parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?

Regards,
Marcel
 
Hi Marcel
try
Outlook._ContactItem myContact = objMyContact as Outlook._ContactItem;
myContact.FirstName=firstname
....
myContact.Save()
 
Stefan said:
Hi Marcel
try
Outlook._ContactItem myContact = objMyContact as Outlook._ContactItem;
myContact.FirstName=firstname
...
myContact.Save()

According to the language reference this would save the contact item in its
default folder. However, the item doesn't need to be stored in the contacts
folder but rather in one specific public folder (the MAPIFolder object in my
pseudo code).


Regards,
Marcel
 
Marcel said:
Hi folks

Does anyone know how to add an object of type ContactItem to an
_Items list? _Items provides an add() method which, however, only
accepts a Variant as parameter... Here's what I do:
- logon to Exchange
- find default folder (public folder)
- navigate to the specific folder (contains contacts)
- as the MAPIFolder object for items -> _Items

and then?


Then I need to invoke move(MAPIFolder). That's all.

Regards,
Marcel
 
Back
Top