none
Expand Contact Group Using Code RRS feed

  • Question

  • Hello, I have a contact group (formerly known as a distribution list)..I have added 3 members to it. I am working on something which requires me to programmatically expand the "+" button. Is this possible? I've looked around quite a bit and I'm confused...I am able to retrieve the members of the Dist List easily but expanding??

    I have attached a picture which highlights the button.


    Wednesday, July 30, 2014 3:53 AM

Answers

  • You would need to delete the original DL and add its members (AddressEntry.Members) one at a time.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Rahul Kishore Wednesday, July 30, 2014 7:55 PM
    Wednesday, July 30, 2014 5:26 AM
  • Hello Rahul,

    The Recipients collection contains a collection of Recipient objects for an Outlook item. So, you can check out the Recipient.AddressEntry property and see whether DisplayType is a distribution list. Use the Add method to create a separate new Recipient object and add it to the Recipients object. Thus, you will expand the distribution list which is represented by a single entry in the To field.

    • Marked as answer by Rahul Kishore Wednesday, July 30, 2014 7:55 PM
    Wednesday, July 30, 2014 9:09 AM

All replies

  • You would need to delete the original DL and add its members (AddressEntry.Members) one at a time.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Rahul Kishore Wednesday, July 30, 2014 7:55 PM
    Wednesday, July 30, 2014 5:26 AM
  • Hello Rahul,

    The Recipients collection contains a collection of Recipient objects for an Outlook item. So, you can check out the Recipient.AddressEntry property and see whether DisplayType is a distribution list. Use the Add method to create a separate new Recipient object and add it to the Recipients object. Thus, you will expand the distribution list which is represented by a single entry in the To field.

    • Marked as answer by Rahul Kishore Wednesday, July 30, 2014 7:55 PM
    Wednesday, July 30, 2014 9:09 AM
  • Eugene and Dmitry, I did this and I had to loop through the Recipient.Address Entry and get it's members, and then call .Add (to add the recipients collection). Thanks to both of you. 
    Wednesday, July 30, 2014 7:55 PM