none
Resolve Resources by name RRS feed

  • Question

  • Hi,

    When creating a meeting request, Some of our end users try to type part of the room name.Our addin will try to match the entered text to a list of rooms.If it finds a match, it displays the SelectNamesDialog so the user can pick the room from a list of available rooms.The SelectNamesDialog resolves selected room successfully and my code below tries to add the resolved recipient/room to the meeting resources:

    foreach (Recipient recip in snd1.Recipients) { if (recip.Resolved) { Recipient rec = appointmentItem.Recipients.Add(recip.AddressEntry.GetExchangeUser().GetExchangeUser().PrimarySmtpAddress);

    rec.Type = (int)OlMeetingRecipientType.olResource; } }

    This works, but the "to" address box will be filled with smtp address of the room instead of the name and this deos not seem to be user friendly.Now if I change the code above to pass the recipient name, the resolve fails, and the "to" address will not have a highlighted text.The room also will not be added to the resources.

    foreach (Recipient recip in snd1.Recipients)
     {
      if (recip.Resolved)
       {
         Recipient rec = appointmentItem.Recipients.Add(recip.Name);         
    
           rec.Type = (int)OlMeetingRecipientType.olResource;                        
       }                                       
     }

    What I described above occurs if running in outlook cached mode but not when cached mode is disabled (see http://support.microsoft.com/kb/831124).

    I also noticed that if I click on the "to" address and add the room as a resource from the room list, the Recipient has the following properties:

    Whereas if I return the recipient from the SelectNamesDialog that I display programatically, the returned recipient room (which resolved by smtp address),  has the following properties:

     

    3 properties are different: the Address,The EntryID, and the Name.

    My question: how can resolve room/resource recipients by name when outlook is in cached mode so that the "to" address will have the resource name not its smtp address.Or why the SelectNamesDialog that I display through code returns different recipients from the ones returned by the normal select name dialog ?.

    Thanks

    Madani


    Thursday, March 22, 2012 2:56 PM

Answers

  • The following worked:

    foreach (Recipient recip in snd1.Recipients) { if (recip.Resolved) { Recipient rec = appointmentItem.Recipients.Add(recip.Name); rec.AddressEntry = recip.AddressEntry; rec.Type = (int)OlMeetingRecipientType.olResource; } }

    appointmentItem.Recipients.ResolveAll();

    the line "rec.AddressEntry = recip.AddressEntry" assigns the AddressEntry of the Dialog recipient to the appointment's, which helps in the resolve logic.



    Thursday, March 22, 2012 3:53 PM

All replies

  • Maybe try passing Address property when adding recipients to collection and/or call ResolveAll on recipients after you add them.
    Thursday, March 22, 2012 3:26 PM
  • Thanks Damian. Passing address property (the active directory long string) or calling ResolveAll did not help.Thanks
    Thursday, March 22, 2012 3:31 PM
  • The following worked:

    foreach (Recipient recip in snd1.Recipients) { if (recip.Resolved) { Recipient rec = appointmentItem.Recipients.Add(recip.Name); rec.AddressEntry = recip.AddressEntry; rec.Type = (int)OlMeetingRecipientType.olResource; } }

    appointmentItem.Recipients.ResolveAll();

    the line "rec.AddressEntry = recip.AddressEntry" assigns the AddressEntry of the Dialog recipient to the appointment's, which helps in the resolve logic.



    Thursday, March 22, 2012 3:53 PM