Outlook 2003 File As Problem

I have Outlook 2003 and when I synched with a phone, the sync process sorted my outlook contacts by full name.  They were originally sorted by File As.  Well the current view is still set to sort by File As.  The Tools-->options-->Contact Options Default File As order is Company(Last, First), changin that to anything else doesn't matter.  verified that Tools-->Accounts--> View or change existing directories or address books--> Outlook Address Book Show names by File As(Smith, JOhn) is selected.

However, in order to get the contact to show up using the File As attibute, I have to edit each contact and change it from File As to Fullname and back to File As.  I really want to do this for ALL the contacts at once so I don't have to manually edit each one.  How can I accomplish this.
mikewinfreyAsked:
Who is Participating?
 
shaileshrConnect With a Mentor Commented:
You can run following VBA macro to set the FileAs property of all the contacts in the Contacts folder programatically:

Sub SetFileAs()
    Dim oContactsFolder As Folder
    Dim oObject As Object
    Dim oContact As ContactItem
   
    Set oContactsFolder = Session.GetDefaultFolder(olFolderContacts)
   
    For Each oContact In oContactsFolder.Items
        oContact.FileAs = oContact.LastNameAndFirstName
        oContact.Save
    Next oContact
       
End Sub

Let me know if you need any further help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.