How to bulk-change "File as" in EXISTING Outlook contacts?

Julieta Bowyer 0 Reputation points
2025-12-06T10:03:25.2166667+00:00

How di bulk-change "File as" in EXISTING Outlook contacts?

Outlook | Web | Outlook on the web for business | Contacts
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-06T10:03:34.1966667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To bulk-change the "File as" format in existing Outlook contacts, you will need to use a macro since Outlook does not provide a built-in feature for this specific task. Here’s a basic outline of how you can do it:

    1. Open Outlook and press ALT + F11 to open the Visual Basic for Applications (VBA) editor.
    2. Insert a new module by right-clicking on any of the items in the Project Explorer, selecting Insert, and then Module.
    3. Copy and paste the following code into the module:
         Sub ChangeFileAsFormat()
             Dim olNS As Outlook.Namespace
             Dim ContactsFolder As Outlook.Folder
             Dim ContactItems As Outlook.Items
             Dim Itm As Object
         
             Set olNS = Application.GetNamespace("MAPI")
             Set ContactsFolder = olNS.GetDefaultFolder(olFolderContacts)
             Set ContactItems = ContactsFolder.Items
         
             For Each Itm In ContactItems
                 If TypeOf Itm Is Outlook.ContactItem Then
                     Itm.FileAs = Itm.FirstName & " " & Itm.LastName
                     Itm.Save
                 End If
             Next Itm
         End Sub
      
    4. Run the macro by pressing F5 or selecting Run from the menu.

    This code will change the "File as" format to "First Last" for all existing contacts in your default Contacts folder. Make sure to adjust the code as necessary to fit your specific requirements.


    References:

    0 comments No comments

  2. Jeanie H 7,770 Reputation points Microsoft External Staff Moderator
    2025-12-08T02:18:42.3433333+00:00

    Dear @Julieta Bowyer

    Thank you for posting your question in the Microsoft Q&A forum.  

    Could you please let me know how you would like to bulk-change the "File as" field in your Outlook contacts? I have found a sample where the string is changed to the first name followed by a space and then the last name. You can try this as a reference. 

    In Outlook, press Alt + F11 to open the Microsoft Visual Basic for Applications window. 

    Select Insert, and then click Module. 

    Paste the code. 

    Private Sub ReFileContacts() 
     Dim items As items, item As ContactItem, folder As folder 
     Dim contactItems As Outlook.items 
     Dim itemContact As Outlook.ContactItem 
     
     Set folder = Session.GetDefaultFolder(olFolderContacts) 
     Set items = folder.items 
     Count = items.Count 
     If Count = 0 Then 
     MsgBox "Nothing to do!" 
     Exit Sub 
     End If 
     
     'Filter on the message class to obtain only contact items in the folder 
     Set contactItems = items.Restrict("[MessageClass]='IPM.Contact'") 
     
     For Each itemContact In contactItems 
     itemContact.FileAs = itemContact.FirstName + " " + itemContact.LastName 
     itemContact.Save 
     Next 
     
     MsgBox "Your contacts have been re-filed." 
    End Sub
    

    Then click Run. 

    Reference: Programmatically Change the Display Format for All Contacts | Microsoft Learn 

    What format would you like to set the "File as" field to? Please reply to this email so I can assist you better. 

    Looking forward to your response! 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.