• Outlook User
  • Exchange Admin
  • Office 365
  • Outlook Developer
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
    • Common Problems
    • Outlook BCM
    • Utilities & Addins

Make the Address Book show only e-mail addresses, not fax numbers

Slipstick Systems

› Outlook › People › Make the Address Book show only e-mail addresses, not fax numbers

Last reviewed on February 13, 2018     14 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

Remove Fax: Prefix

To remove Fax: from the Fax number, replace the If block with this.

          If InStr(.BusinessFaxNumber, "Fax: ") Then
            .BusinessFaxNumber = Replace(.BusinessFaxNumber, "Fax: ", "")
        End If
          .Save

If you have duplicate fax prefixes (caused by running the macro more than once), or to prevent duplicates when you update contacts, use this to remove and replace the prefix:

          If InStr(.BusinessFaxNumber, "Fax: ") Then
            .BusinessFaxNumber = Replace(.BusinessFaxNumber, "Fax: ", "")
        End If
          .Save
          
           If .BusinessFaxNumber <> "" Then
               olfax = .BusinessFaxNumber
           .BusinessFaxNumber = "Fax: " & olfax
        End If
          .Save

How to use the HideFaxNumbers Macro Tutorial

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

More Information

  • Enabling the Outlook Address Book and Contacts folder
  • OL2002- Contacts with Both an E-Mail Address and a Fax Number Are Listed Twice When You Select an E-mail Recipient

Make the Address Book show only e-mail addresses, not fax numbers was last modified: February 13th, 2018 by Diane Poremsky
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Print

Related Posts:

  • resolved contact address
    Imported Addresses are Missing from Address Book
  • Update Contacts with a New Company Name and Email Address
  • Format Contact phone numbers to use with Skype
  • Bulk Move Phone Numbers to a Different Phone Field

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
14 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Craig (@guest_197667)
April 5, 2016 2:50 pm
#197667

Hi Diane,
Thank you for posting this information. The macro worked great for my default contact folder. How would I modify this to accommodate a ShareFile contacts library? I have a Sharefile library listed under Other Contacts in Outlook, The Sharefile contacts are enabled to appear in my Outlook Address Book.

Thank you,
Craig

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Craig
April 5, 2016 4:15 pm
#197670

This tells it which folder to use:
Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)

Change it to
Set objContactsFolder = Application.ActiveExplorer.CurrentFolder

Select the sharepoint contacts folder and run it.

0
0
Reply
Amie Vader (@guest_188247)
December 18, 2014 11:03 am
#188247

I have several subfolders in my Contact folder. How can I get this to apply to those contacts as well?

0
0
Reply
Danilo Jacobs (@guest_190751)
Reply to  Amie Vader
May 4, 2015 5:25 am
#190751

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

0
0
Reply
Meredith (@guest_187916)
December 1, 2014 4:26 pm
#187916

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

0
0
Reply
Diane Poremsky (@guest_187921)
Reply to  Meredith
December 1, 2014 7:42 pm
#187921

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")

0
0
Reply
MP (@guest_185860)
September 15, 2014 3:23 pm
#185860

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!

0
0
Reply
Diane Poremsky (@guest_185865)
Reply to  MP
September 15, 2014 8:39 pm
#185865

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.

0
0
Reply
MP (@guest_185959)
Reply to  Diane Poremsky
September 17, 2014 10:20 am
#185959

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...

0
0
Reply
Diane Poremsky (@guest_186001)
Reply to  MP
September 18, 2014 12:15 am
#186001

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.

0
0
Reply
Josh (@guest_177790)
June 20, 2013 8:48 pm
#177790

I pasted the code in VBA, and got an snytax error message. Anything else I need to do?

0
0
Reply
Diane Poremsky (@guest_177791)
Reply to  Josh
June 20, 2013 10:43 pm
#177791

Any read lines? What line did it error on?

0
0
Reply
Chris Brown (@guest_159136)
August 3, 2012 7:21 am
#159136

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

0
0
Reply
Diane Poremsky (@guest_159350)
Reply to  Chris Brown
August 3, 2012 8:41 pm
#159350

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

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 28 Issue 22

Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Subscribe to Exchange Messaging Outlook






Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • WeekMonthAll
  • How to Remove the Primary Account from Outlook
  • Adjusting Outlook's Zoom Setting in Email
  • Outlook: Web Bugs & Blocked HTML Images
  • Save Sent Items in Shared Mailbox Sent Items folder
  • Move an Outlook Personal Folders .pst File
  • Create rules that apply to an entire domain
  • Use PowerShell to get a list of Distribution Group members
  • View Shared Calendar Category Colors
  • How to Create a Pick-a-Meeting Request
  • Outlook Auto Account Setup: Encrypted Connection not available
  • Send Individual Messages when Sending Bulk Email
  • Centrally managed signatures in Office 365?
  • Create a rule to delete spam with no sender address
  • Open Outlook Folders using PowerShell or VBScript
  • Cannot add Recipients in To, CC, BCC fields on MacOS
  • Change Appointment Reminder Sounds
  • Messages appear duplicated in message list
  • Reset the New Outlook Profile
  • Delete Old Calendar Events using VBA
  • Use PowerShell or VBA to get Outlook folder creation date
Ajax spinner

Newest Code Samples

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Format Images in Outlook Email

Set Outlook Online or Offline using VBScript or PowerShell

List snoozed reminders and snooze-times

Search your Contacts using PowerShell

Filter mail when you are not the only recipient

Add Contact Information to a Task

Process Mail that was Auto Forwarded by a Rule

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Outlook Links Won’t Open In Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook Top Issues

  • The Windows Store Outlook App
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Diane Poremsky [Outlook MVP]

Make a donation

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Submit Outlook Feature Requests

Slipstick Support Services

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Advertise | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2023 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment