Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    EmailDisplayName property won't stick (2002-SP1)

    Hi, all. I'm working on a custom contact form to maintain a list of students and their parents, among other details. I've written VBScript code to populate the built-in Email[1,2,3]Address and Email[1,2,3]DisplayName fields with values from my custom "Parent[1,2]EmailAddress", "StudentEmailAddress", "Parent[1,2]FullName", and "StudentFullName" fields. I'm trying to do this to retain as much of the built-in functionality as possible, especially the "new message to contact" action.

    I've used a custom control and an Item_CustomPropertyChange event to select which of the three are to receive email when a new email is created; depending on the choice made, the appropriate built-in email fields that Outlook draws on when creating a new message are populated or reset to empty. (Outlook picks up all three automatically when composing a new message.)

    The problem is this: Outlook 2002 refuses to leave the EmailDisplayName field values alone, and insists on overwriting all three with the FileAs value upon saving the contact. This appears to happen only if the corresponding EmailAddress fields contain something. What it means is that I get something like "Student Test (mother@bla.com); Student Test (father@bla.com); Student Test (student@bla.com" instead of "Mother Test (mother@bla.com); Father Test (father@bla.com); Student Test (student@bla.com)".

    I've tried to reset my values in the EmailDisplayName fields as part of an Item_Write event, but Outlook overwrites my values even after this.

    Any ideas on circumventing this frustrating behavior? I suppose I could write a custom "new message to contact" action to populate the "To:" field with what I want, but I'm trying to avoid this. It would be nice if I could disable the function behind the built-in "E-mail Display As" field, but I can't see that this is possible.

    Many thanks for any help,

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: EmailDisplayName property won't stick (2002-SP1)

    I have had similarly frustrating experiences (see <!post=Post #107360,107360>Post #107360<!/post>), but since those display names, at least in OL2K, do not willingly appear when you are addressing a message (see <!post=Post #146263,146263>Post #146263<!/post>), maybe it's a wasted effort.

  3. #3
    New Lounger
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: EmailDisplayName property won't stick (2002-SP1)

    Thanks for confirming my suspicions, Jefferson. Guess I'll just have to deal. At least I can submit a bug report to MS on this... And thanks too for the pointer to your mass domain change code, that's useful. Hope it's cooler where you are than here!

  4. #4
    New Lounger
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: EmailDisplayName property won't stick (2002-SP1)

    An update: I don't have to "deal" after all, though I do still think it's a bug. Thanks to a pointer from Sue Mosher over in the msnews Outlook forms programming NG (that I recently found again), there is a workaround:
    Save a reference to the original value of Item.FullName, then change the Item.FullName property to the name you want displayed for the Item.Email2Address/DisplayName or Item.Email3Address/DisplayName properties. Change 2, then Item.Save. Set the FullName again if it's to be different, then Change 3, then Item.Save again. Finally, revert the contact back to the original FullName value, set 1, and close.

    So far this seems to work fine--I get Joe Student (student@blah.com), Mother Student (mother@blah.com), and Father Student (father @blah.com. Only problem I had to work around was that my "Send e-mail to" droplist wouldn't retain the most recent selection, and I think it had something to do with the FullName property changing. I didn't narrow it down completely, but resetting the selection after messing with the FullName property seems to have done the trick.

    Hope this helps some other poor sucker like me! <bg>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •