Last reviewed on December 1, 2014   —  12 Comments

Microsoft Outlook considers fax numbers to be valid e-mail addresses. If you want to be able to send both e-mails and faxes from Outlook, there’s no solution to this issue.

If you are keeping the fax numbers just as a matter of record, though, and don’t use them in Microsoft Outlook, then you can choose one of the non-fax phone number fields to store the fax number information. Unfortunately, you can’t change the names of the built-in fields; you would need to remember which field contains fax numbers.

Another approach is to put text in front of the fax number, such as "W: " for a work fax or just "Fax:"; this causes the number to disappear from the Outlook Address Book, but keeps it easy to see the number in the contact record or Contacts folder. The tools listed below add a prefix automatically and remove it when you need to dial the number.

Macro to prefix Fax numbers

You can run the following macro to refix fax numbers with Fax: so they won’t show in the address book.

Replace BusinessFaxNumber with HomeFaxNumber or OtherFaxNumber if you need to hide other fax numbers.

Removing the Fax prefix from numbers requires more complicated VBA code to strip only the prefix and is more prone to error. Because of this we recommend using an addin that can toggle the prefix off and on.

Public Sub HideFaxNumbers()
    Dim objOL As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objContact As Outlook.ContactItem
    Dim objItems As Outlook.Items
    Dim objContactsFolder As Outlook.MAPIFolder
    Dim obj As Object
    Dim olfax As String

    On Error Resume Next

    Set objOL = CreateObject("Outlook.Application")
    Set objNS = objOL.GetNamespace("MAPI")
    Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)
    Set objItems = objContactsFolder.Items

    For Each obj In objItems
        'Test for contact and not distribution list
        If obj.Class = olContact Then
            Set objContact = obj

     With objContact

          If .BusinessFaxNumber <> "" Then
               olfax = .BusinessFaxNumber
           .BusinessFaxNumber = "Fax: " & olfax 
        End If
          .Save

     End With
        End If

     Err.Clear
    Next

    Set objOL = Nothing
    Set objNS = Nothing
    Set obj = Nothing
    Set objContact = Nothing
    Set objItems = Nothing
    Set objContactsFolder = Nothing
End Sub

How to use the HideFaxNumbers Macro Tutorial

Tools

Hide Business Fax Numbers From Address Book

This software will change all fax numbers for a contact to have a pre-pended character before the number so the address book won't recognize it as a valid address. Then when you click "To:" and get the Address Book dialog box, you'll only see email addresses listed.

Hide Fax Numbers

Changes all fax numbers for a contact to have "Fax:" (or other text) before the number. This prevents Outlook from recognizing it as a valid address, so you won't see it in the Outlook Address Book. You can strip the prefix text at any time, for one contact or all of them at once, on demand or as numbers are added. Works on multiple Outlook folders for nested contact folders. Enter code WD9BHK53 during checkout.

How to use macros

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.

After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Open the VBA Editor by pressing Alt+F11 on your keyboard.

To put the code in a module:

  1. Right click on Project1 and choose Insert > Module
  2. Copy and paste the macro into the new module.

More information as well as screenshots are at How to use the VBA Editor

Comments

  1. Chris Brown says

    Nice idea, and piece of code.
    I used your code inside a macro and deployed it in my company, now all of my contacts have FAX: as a prefix.
    However in Outlook 2010 and 2007 which we use, the address book still shows the fax numbers.
    Anything else I should try?

    Regards
    Chris

    • Diane Poremsky says

      Are the contacts with fax: in your local contacts folder or the GAL? the fax prefix should remove them from the address book.

  2. MP says

    I have a user w/over 8k contacts & has this same issue. I don't know where I should put this code & how/when it runs. I assume I should copy & paste it in a text file & give it a .vba extension & save it where? Any help would be great. Thx!

    • Diane Poremsky says

      I added a video tutorial to the page. Set macro security to low, press alt+F11 to open the editor or show the developer ribbon, right click on Project1 and choose Insert > Module. paste in the code and run. It may take a few minutes to run it on 8000 contacts. It'll save running in the title bar while its running.

    • MP says

      Hi Diane, Thank you for taking the time to answer my question & the very helpful video. I ran into a problem though. After pasting the code in the vb editor I got this error message:
      Compile Error:
      End If without block If.
      I believe its Line 30 Col 15. I made sure that it doesn't have a hidden space or formatting. Any ideas? I've come so close...

    • Diane Poremsky says

      Is anything red? I'm not getting an error here - that error usually means there are too many End if lines and not enough If.

      These are my 14 and 15:
      End With
      End If
      That end if matches the if obj.class line and there is set of if/end if that checks the business number.

  3. Meredith says

    Thanks for posting this. I notice the video states this is for default contact folder. Can this be changed to a public folder?

    • Diane Poremsky says

      You can. You need to use olPublicFoldersAllPublicFolders and walk down the folders if the contacts folder is deeply nested. If it's near the top of the folder tree, you can this:
      Set objContactsFolder = objNS.GetDefaultFolder(olPublicFoldersAllPublicFolders).folders("folder-name").folders("contacts-folder")

    • Danilo Jacobs says

      Hey, i had the same problem with the subfolders and a friend modified the macro and it worked flawlessly. Here it is

      Public Sub HideFaxNumbers()
      Dim objOL As Outlook.Application
      Dim objNS As Outlook.NameSpace
      Dim objContact As Outlook.ContactItem
      Dim objItems As Outlook.Items
      Dim objContactsFolder As Outlook.MAPIFolder
      Dim obj As Object
      Dim olfax As String

      On Error Resume Next

      Set objOL = CreateObject("Outlook.Application")
      Set objNS = objOL.GetNamespace("MAPI")
      Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)

      Set objFolders = objContactsFolder.Folders

      For Each objFolder In objFolders

      Set objItems = objFolder.Items
      For Each obj In objItems
      'Test for contact and not distribution list
      If obj.Class = olContact Then
      Set objContact = obj

      With objContact

      If .BusinessFaxNumber "" Then
      olfax = .BusinessFaxNumber
      .BusinessFaxNumber = "Fax: " & olfax
      End If
      .Save

      End With
      End If

      Err.Clear
      Next

      Next

      Set objOL = Nothing
      Set objNS = Nothing
      Set obj = Nothing
      Set objContact = Nothing
      Set objItems = Nothing
      Set objContactsFolder = Nothing
      End Sub

Leave a Reply

Please post long or more complicated questions at OutlookForums by Slipstick.com.

If the Post Comment button disappears, press your Tab key.