OfficeDev / VBA-content

All content in this repository has been migrated to a new repository (https://github.com/MicrosoftDocs/VBA-Docs). Please do not open issues or pull requests here. We are no longer monitoring this content.
https://github.com/MicrosoftDocs/VBA-Docs
Creative Commons Attribution 4.0 International
564 stars 434 forks source link

addressEntry method returing wrong address book entry for exchange user string #154

Closed jns4u closed 8 years ago

jns4u commented 8 years ago

before calling GetExchangeUser() Method for Address entry, setting AddressEntry object for Exchange user string resulting to wrong email address or any other exchange user details.

For instance, we want email address of exchange users who's entries are available in outlook address book so if there is entry for user "Jai" in outlook address book that is also exchange user and if we are passing exchange user string representing user "Jack" who's entry is not available in outlook address book resulting email address of "Jai" rather than Null.

This is absolute bug with this method which is taking string comparison based on character set and if not found returning first entry based on first letter of user string that we are passing.

laschultz commented 8 years ago

Added note to the Remarks section of VBA-content/blob/master/Outlook-VBA/articles/eaaafd52-42c9-7f6b-1acb-0b987496d604.md:

If a string passed using this method has a character set that is similar to an existing address entry, the return value may include an entry that is matched based on the first letter of the string passed.

For example, you pass the string "Jack" for an Exchange user who has an address entry "Jai" in his Outlook address book, but not "Jack". Even though the "Jack" entry is not available in the Outlook address book, the email address returned is "Jai" rather than "Null".

laschultz commented 8 years ago

Added note to the Remarks section to add clarification for using this method.