E-mail Display As field problem

D

Dan

I am using Outlook 2007. I have written a VB program to programatically add
contacts. Everything is working fine, except that I don't like the format of
the E-mail Display As field. It is "CompanyName (Email1Address)". I would
like it to be only "CompanyName".

When I create a new ContactItem in my code, I am defining the following
fields (in this order):

..FirstName
..MiddleName
..LastName
..CompanyName
..FileAs
..Email1Address
..Email1DisplayName

I suspect that some of these are derived fields. How do I tell which are
derived fields? Which of these should I be defining in my code?

I am defining .Email1DisplayName to be the same as .CompanyName, yet it is
still getting .Email1Address appended to it with parentheses. How do I get it
to keep the DisplayName the way I defined it in my code?

Thanks for your help!
 
D

Diane Poremsky [MVP]

you're probably hitting the automatic display name feature where it appends
the address to the name when you create a contact. If you create the
contact then update the display name you won't get the address, but there
may be a better way and someone in the outlook.programming_vba group may
have the answer.

--
Diane Poremsky [MVP - Outlook]



Outlook Tips by email:
mailto:[email protected]

EMO - a weekly newsletter about Outlook and Exchange:
mailto:[email protected]

You can access this newsgroup by visiting
http://www.microsoft.com/office/community/en-us/default.mspx or point your
newsreader to msnews.microsoft.com.
 
K

Karl Timmermans

There is no way to override Outlook when it populates the Email#DisplayAs
field on initial contact creation.

In short.....

#1 - Populate all your <primary> fields before you create (save) the contact
item for the first time
#2 - Once saved, then update the fields you want and re-save the item i.e.
olc.FirstName = "FName"
olc.LastName = "LName"
olc.Email1Address = "(e-mail address removed)~m"
olc.Save
olc.Email1DisplayAs = "Whatever"
olc.Save
*** no need to populate EDA on initial creation since Outlook is
going to override it when
the contact item gets created (provided there is an email
address)
#3 - If email address gets subsequently changed via the UI - the DisplayAs
will get
changed by Outlook automatically which for O'2007 is <contactname
(email address)>.
However, if you only change the contact's name info - the EDA will
not change.
#4 - <FileAs> should populate as per the Outlook UI setting when the contact
is initially created
(same is not true when using the Outlook import wizard).

Karl
___________________________________________________
Karl Timmermans - The Claxton Group
ContactGenie - Importer 1.3 / DataPorter 2.0 / Exporter
"Power contact importers/exporters for MS Outlook '2000/2007"
http://www.contactgenie.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top