none
I am trying to create Contact inside Contact Group. RRS feed

  • Question

  • Hello,

    I am trying to create Contact inside Contact Group.

    Outlook 2010

    I know how to create Contact in Contacts Folder not in group:

    ContactItem newItem = this.app.CreateItem(OlItemType.olContactItem);

    newItem.LastName = "aaaax1";

    newItem.Email1Address = "test@comp.com";

    newItem.Save();

    Does anybody know how this can be done?

    thank you


    • Edited by DrMegavolt Thursday, November 24, 2011 5:01 PM
    Thursday, November 24, 2011 5:00 PM

Answers

  • Do you mean you are trying to create a contact in a folder other than the default Contacts folder?

    use MAPIFolder.Items.Add("IPM.Contact") (where MAPIFolder points ot the folder in question) instead of Application.CreateItem.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Monday, November 28, 2011 5:45 AM

All replies

  • Hi DrMegavolt,

     

    Thanks for posting in the MSDN Forum.

     

    Do you mean create contact item with out use “ContactItem newItem = this.application.CreateItem(OlItemType.olContactItem);” ?

     

    Have a good day,

     

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Saturday, November 26, 2011 8:20 AM
    Moderator
  • Do you mean you are trying to create a contact in a folder other than the default Contacts folder?

    use MAPIFolder.Items.Add("IPM.Contact") (where MAPIFolder points ot the folder in question) instead of Application.CreateItem.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!
    Monday, November 28, 2011 5:45 AM