Skip to main content

How to hide fax number in Select Names List in Outlook?

Author: Sun Last Modified: 2020-11-19

In Outlook, you may have discovered that in the “Select Names” list or address book, the E-mail address column contains not only the email addresses but also the fax entries which maybe annoy you. In this article, I introduce some ways to hide the fax number for you.
doc hide fax number 1

Hide fax number in Select Names list with VBA


Hide fax number in Select Names list with VBA

If you want to hide the existed fax number in Select Name list, please do as this:

1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window.

2. Click Insert > Module to insert a new blank module, copy and paste below code to the script.

VBA: Hide exist fax number in Select Names

Sub HideFaxNumbers_ExistingContacts()
'UpdatebyExtendoffice2018-5-23
Dim xStores As Outlook.Stores
Dim xStore As Outlook.Store
Dim xRootFolder As Outlook.Folder
Dim xFolder As Folder
On Error Resume Next
Set xStores = Outlook.Application.Session.Stores
For Each xStore In xStores
    Set xRootFolder = xStore.GetRootFolder
    For Each xFolder In xRootFolder.Folders
        Call ProcessFolders(xFolder)
    Next
Next
End Sub
Sub ProcessFolders(ByVal CurrentFolder As Outlook.Folder)
Dim xContactItem As Outlook.ContactItem
Dim xSubFolder As Outlook.Folder
Dim xFax As String
Dim I As Integer
On Error Resume Next
If CurrentFolder.DefaultItemType <> olContactItem Then Exit Sub
xFax = "Fax: "
For I = CurrentFolder.Items.Count To 1 Step -1
    Set xContactItem = CurrentFolder.Items.Item(I)
    With xContactItem
        If (Len(.BusinessFaxNumber) <> 0) And InStrRev(.BusinessFaxNumber, Trim(xFax)) = 0 Then
            .BusinessFaxNumber = xFax & .BusinessFaxNumber
        End If
        If (Len(.HomeFaxNumber) <> 0) And InStrRev(.HomeFaxNumber, Trim(xFax)) = 0 Then
            .HomeFaxNumber = xFax & .HomeFaxNumber
        End If
        If (Len(.OtherFaxNumber) <> 0) And InStrRev(.OtherFaxNumber, Trim(xFax)) = 0 Then
            .OtherFaxNumber = xFax & .OtherFaxNumber
        End If
        .Save
    End With
Next I
If CurrentFolder.Folders.Count <> 0 Then
    For I = CurrentFolder.Folders.Count To 1 Step -1
        Set xSubFolder = CurrentFolder.Folders.Item(I)
        Call ProcessFolders(xSubFolder)
    Next I
End If
End Sub

3. Press F5 key to run the code, now the fax numbers have been hidden.
doc hide fax number 2

If you want to hide the fax number in new contacts, do as this:

1. Press Alt + F11 keys to enable Microsoft Visual Basic for Applications window.

2. Double click ThisOutlookSession from Project-1 pane, and then copy and paste below code to the script.

VBA: Hide fax number in new added contacts

Public WithEvents xInspectors As Outlook.Inspectors
Public WithEvents xContactItem As Outlook.ContactItem
Private Sub Application_Startup()
'UpdatebyExtendoffice2018-5-23
    Set xInspectors = Outlook.Application.Inspectors
End Sub
Private Sub xInspectors_NewInspector(ByVal Inspector As Inspector)
If TypeName(Inspector.CurrentItem) = "ContactItem" Then
    Set xContactItem = Inspector.CurrentItem
End If
End Sub
Private Sub xContactItem_PropertyChange(ByVal Name As String)
Dim xArr() As Variant
Dim xFax As String
On Error Resume Next
xArr = Array("BusinessFaxNumber", "HomeFaxNumber", "OtherFaxNumber")
xFax = "Fax: "
With xContactItem
    Select Case Name
        Case xArr(0)
            If InStrRev(.BusinessFaxNumber, Trim(xFax)) = 0 Then
                .BusinessFaxNumber = xFax & .BusinessFaxNumber
            End If
        Case xArr(1)
            If InStrRev(.HomeFaxNumber, Trim(xFax)) = 0 Then
                .HomeFaxNumber = xFax & .HomeFaxNumber
            End If
        Case xArr(2)
            If InStrRev(.OtherFaxNumber, Trim(xFax)) = 0 Then
                .OtherFaxNumber = xFax & .OtherFaxNumber
            End If
    End Select
End With
End Sub
doc hide fax number 3

3. Save the code and restart the Outlook to make the code effect.

From now on, all fax numbers of new created Contacts will be hidden in the Select Names: Contacts window.

doc hide fax number 4
doc arrow down
doc hide fax number 5

Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

🤖 Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

📧 Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

📨 Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

📁 Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

👍 One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  🕘Show Sender's Time Zone ...

👩🏼‍🤝‍👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single click—permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, this macro is great, it solved my issue!I have just one question: do I have to run it each time I open OutLook? Or is there a way to automate the macro?Thank you!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations