How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Michael Hannigan Your Own Question
Michael Hannigan
Michael Hannigan, Email Expert
Category: Email
Satisfied Customers: 11817
Experience:  25+ Years Experience in Field. MCSE, ICCP, Expert in Large Email Platforms
Type Your Email Question Here...
Michael Hannigan is online now
A new question is answered every 9 seconds

I have an access 2013 database that, among other things,

Customer Question

I have an access 2013 database that, among other things, creates outlook contacts. This works perfectly... but the one thing that I cannot figure out or find documentation on is how to set the appropriate telephone label from the dropdown list using VBA. For example... I have "Business..." and "Business 2..." phone numbers. The number is ***** perfectly but I would like to change the second phone field label to "Business 2...". How do I do this in VBA?
Submitted: 1 year ago.
Category: Email
Expert:  Tim replied 1 year ago.

Hi there, I'm Tim and will be assisting you today. I have over 15 Years as an Engineer and have been with eBay, DoD and many others. I will do my very best to help you. If you like i can offer a phone call or remote session to make things quicker and easier.

Expert:  Tim replied 1 year ago.

Sorry, not super familiar with VBA, i will opt out.

Expert:  Michael Hannigan replied 1 year ago.

Hello. My name is Michael. I will be helping you with your question today.

Expert:  Michael Hannigan replied 1 year ago.

Can you please describe what you are looking for in terms of a deliverable?

Customer: replied 1 year ago.
I am looking for the language feature or technique to accomplish this. my VBA code to save an Outlook Contact is pretty straight forward... I'm using .CreateItem(olContactItem) and populating the fields that I want to include. Of these fields, there are two phone numbers (they will be Business... and Business 2... The problem is, the "field label" for Business 2... in Outlook is selected from a drop down of phone number types. I am setting the value for Business 2... but just setting the value doesn't set the label and hence doesn't make the phone number in Business 2... visible (you would have to drop the menu list down manually and select Business 2... How can I from VBA code accomplish this? I would like to do it when I set the value for the phone number. I just can't find any documentation or reference to this. There has to be a way. I would greatly appreciate the language feature or a few lines of sample code... or point me in the right direction for some documentation. Any help or assistance would be greatly appreciated.
Expert:  Michael Hannigan replied 1 year ago.

If you are referring to the form itself, where you are looking at the data in a user presentable format, you can just change the text label on that field on the form. It doesn't have to be the same as the field name. I suspect that your question is more complex than that, though. And you are right, there has to be a way. The outlook data structure is complex in a lot of ways, and there are many ways to query it. Here's a good place to start:

It primarily depends on how the outlook tables are linked in access.

Customer: replied 1 year ago.
If there wasn't so many records, then I would have them just select the label manually. Fortunately, when viewing the contact on a mobile phone, both numbers are visible and get labeled "Work" with the direct number always listed first. In Outlook itself, you would not at first glance know there was a second business number since you wouldn't see it until you dropped the list down and selected "Business 2..." as your label (the defaults being "Business...", "Home...", "Business Fax...", and "Mobile...". I assign values to the fax number and the mobile number so they are not a problem, but I really don't want to use "Home..." to be the other business number just so it shows up automatically. You would think there would be an obvious way to do this. I am still going though the information on the link you provided but I haven't found anything I can use yet. Do you know of a good VBA reference page or a good printed reference? Where can I see the use and syntax for the Outlook Contact code?
Expert:  Michael Hannigan replied 1 year ago.

Yes, there is an official reference from Microsoft that has a lot of detail. Here's a link to it:

In particular, the ContactItem Properties defines how the phone number records are defined.


Expert:  Michael Hannigan replied 1 year ago.

The phone numbers to which you are referring I believe are

BusinessTelephoneNumber Property


Business2TelephoneNumber Property

Customer: replied 1 year ago.
Okay... I am closer. I have found out that the best way (maybe the only way) to do this is to create a custom outlook contacts form with the defaults that I want. I created one and it works, but it only works if I create the contact manually. I still need to figure out how to change the message class (that contains the custom for) for a specific contact using access vba.
Expert:  Michael Hannigan replied 1 year ago.

When you say create the contact manually, you mean through the form you created?

Expert:  Michael Hannigan replied 1 year ago.

I think I understand finally what you are saying. If you pull up a normal outlook contact form, for phone numbers, you have Mobile, Home, Business Fax, Business... whatever your defaults are. You can set business there. You can also pull down the dropdown and select "Business2" from it. But Business2 is not one of the defaults under phone numbers. But you would like it to be. Am I on the right track?

Expert:  Michael Hannigan replied 1 year ago.

And one of the problems is that you can change the label from "home", for example, to business2, but that doesn't actually change the field.

Expert:  Michael Hannigan replied 1 year ago.

The message class being IPM.Contact

Customer: replied 1 year ago.
I created a custom contact form in Outlook with the fields/labels for
Business 2...
Business Fax...instead of the normalBusiness...
Business Fax...and I edited the properties of the Contacts folder and told it to use this new form as the message class for new contacts. It works... when I click on "New" I see my form for fill out. It doesn't work for existing Contacts, but I did find a VBA code example and also a utility that will handle that (I haven't tried it yet). My problem is that my VBA code from my database doesn't use the new form (it still uses the original form, even though the folder is set to use the new one). I even found a code example to change the message class (hence the form) for existing contacts and it run with no errors but doesn't use the new form. I tested it with a "fake" non-existent message class and it errored out saying it didn't exist... so it apparently works to a point. I can't find any more documentation.
Expert:  Michael Hannigan replied 1 year ago.

Ok... I think what you are looking for is to replace the form region. Since you can't do anything to change the standard outlook contact form. You can use the same message class derived from the original - in fact, you'll see here, f you do a replace-all form region to replace the entire standard form, you must specify a derived message class for the form region and register the form region for that message class. But that should allow you to create your own message class and use it in place of the default.

Expert:  Michael Hannigan replied 1 year ago.

Oh... the page would help -

Expert:  Michael Hannigan replied 1 year ago.

Really... only Microsoft could make something so basic so mind-bendingly complicated.