Problem in changing ContactItem.Email1DisplayName

  • Thread starter Thread starter Yuan Nan via OfficeKB.com
  • Start date Start date
Y

Yuan Nan via OfficeKB.com

Hi All,
I want to change ContactItem.Email1DisplayName value, but the program
does not function. No matter how I set this field in my code, the
Email1DisplayName is always set to "Name (Mail Address)" like "yuan nan
([email protected])".
My code writed like this:

Set objApp = Application
Set objNS = GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(olFolderContacts)
Set objContactItem = objFolder.Items.Add(2)
objContactItem.Email1DisplayName = "yuan nan"
objContactItem.Email1Address = "(e-mail address removed)"
objContactItem.Save
 
Did you try changing the address, then the display name, in other words,
reversing the order? Outlook version?
 
I have tried reversing the order, but it still doesn't function.
I use Outlook 2003.
 
Back
Top