locked
Bug In Outlook.AddressEntry object? The email address I enter in the "To" line gets changed to the one in my Contacts. RRS feed

  • Question

  • I'm using Outlook 2013 Professional Plus  (15.0.4919.1001) MSO (15.0.4919.1002) 32-Bit


    STEPS TO REPRODUCE

    Add John.Doe@YourDomain.com to your contacts list so that the display name appears as (without the quotes) "John Doe (john.doe@YourDoman.com)"

    Save this entry in your Contacts.

    Open a New Email window and enter the following (without the quotes) "John Doe <john.doe@differentdomain.com>"

    Now press Enter (or any other key combo so the "To" line loses focus)

    RESULT:  The address is changed to the address you created in your Contacts.

    It looks like the object model is parsing out the "John Doe" portion of the email address and is performing some unwanted name resolution.

    NOTE:  This does not happen in Outlook 2016 Professional.


    Sunday, June 18, 2017 8:14 PM

Answers

  • I don't know if there is much you can do using OOM alone - you are only limited to Recipients.Add when adding recipients, and Recipients.Add always takes a name which is later resolved. There is no way to pass both the name and the address to create a one-off recipient in the resolved state. Is switching to Extended MAPI (C++ or Delphi) or Redemption (it exposes Recipients.AddEx) an option?

    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 GermanEZI Monday, June 19, 2017 8:28 PM
    Monday, June 19, 2017 2:27 PM

All replies

  • Hi GermánH,

    I can see that issue can be reproduce by the user interface.

    this forum generally handles the code related issues.

    so I think that Outlook it pro discussions forum is the best forum for this issue.

    so for better response and better solution for your issue, I move this thread to Outlook it pro discussions forum.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thank you for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 19, 2017 3:04 AM
  • Thank you Deepak.

    I am writing an Add-In that has to deal with this issue.  My Recipient object ends up with the wrong email address.  I found this by inspecting the AddressEntry properties.

    I don't know if that would classify this thread as code or User Interface related.   It was easier to explain, if I gave a UI example.



    • Edited by GermanEZI Monday, June 19, 2017 3:30 AM Clarification
    Monday, June 19, 2017 3:25 AM
  • I don't know if there is much you can do using OOM alone - you are only limited to Recipients.Add when adding recipients, and Recipients.Add always takes a name which is later resolved. There is no way to pass both the name and the address to create a one-off recipient in the resolved state. Is switching to Extended MAPI (C++ or Delphi) or Redemption (it exposes Recipients.AddEx) an option?

    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 GermanEZI Monday, June 19, 2017 8:28 PM
    Monday, June 19, 2017 2:27 PM
  • Dimitry,

    I've heard we have a Redemption license, or at least that the license is up for renewal.   I'll check with my manager.
    Monday, June 19, 2017 6:40 PM
  • Dmitry,

    I just want to be sure that I'm clear.  All I'm trying to do is make sure that the email address entered on the "To" line does not get automatically changed by Outlook.  

    I'm not trying to add a recipient programmatically; I may have to if I can't get around this behavior of Outlook 2013.  Again ... Outlook 2016 does not exhibit this behavior. 

    Monday, June 19, 2017 6:48 PM
  • So how is recipient added? If you enter john.doe@differentdomain.com, it should resolve fine. I can reproduce the problem only if both name and address in the form of  "John Doe <john.doe@differentdomain.com>" are entered. But would the user actually type the whole string?

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

    Monday, June 19, 2017 7:16 PM
  • I seriously doubt that they would type the whole string.

    I was a little surprised to see the email address I typed in suddenly changed by Outlook.  

    Do you know if this is a bug, or simply a feature?   It's something I'll need to report to our testing team so I'm not up all night trying to find a "fix" for something that's not broken.

    Again, this issue doesn't occur in 2016.


    • Edited by GermanEZI Monday, June 19, 2017 8:02 PM Clarification
    Monday, June 19, 2017 8:01 PM
  • Actually I was able to reproduce this problem in Outlook 2016.

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

    Monday, June 19, 2017 8:10 PM
  • Wow!  I'll check my 2016 Installation in a bit.  I'd like to give you the version I'm testing on.

    There's a chance I may not have updated the Contact on my 2016 installation, as I thought I did.

    I'm just hoping that a Microsoft Moderator will show up and tell me if this is a bug or a feature, just so I can complete this issue.

    Hey, thanks Dimitry ... I'll let our testing team know that this will be a training issue that users should be aware about, but not to be overly concerned since it's highly unlikely that they'll type in that entire string.

    In the mean time, I'll ask if we have Redemption.

    Thanks!

    Monday, June 19, 2017 8:27 PM
  • I have a rather similar problem in Outlook 2010 with the Send method of the MailItem object, even when using the To property of the MailItem object instead of the Recipient.Add method.

    Isn't there any way to force Outlook to use the To property "as it is" (without any resolution) when you call the Send method?


    • Edited by apao Tuesday, June 20, 2017 5:10 PM
    Tuesday, June 20, 2017 5:07 PM
  • There is no such thing as "as-is" - one way or another, the specified string must be resolved. If you already know the SMTP address, you can use Extended MAPI or Redemption (using Recipients.AddEx) to create a recipient in the resolved state (with PR_ENTRYID of the recipient being a one-off entry id). OOM still attempts to resolve the name, and that is where the problem manifests itself - when it parses the provided string, it extracts both name and email address, but instead of using the email address to create a one-off recipient, it only uses the name to resolve against the address book. That's a bug.


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

    Tuesday, June 20, 2017 5:29 PM
  • Thanks for your answer.
    Tuesday, June 27, 2017 10:44 AM