Outlook 2007 File As Field

Hi Experts -

I have a user that was using entourage 2004 and we migrated over all her contacts (3000+) to our new system (Outlook 2007 / Exchange 2007) but her contacts are missing the file as field.  The file As field is missing; therefore, it is not allowing her to send emails from outlook.  My question... Is there a way to bulk modify all the contacts so that it can change the file as to Last, First?  I would hate to do it one by one for all 3000+ contacts.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi, Undisputed.

This is easily done with the script below.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comments wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Select the Contact folder by clicking on it in the folder list
9.  Run the macro

The code loops through all the contacts in the folder setting FileAs to LastName, FirstName.  The code will only work in Outlook, not Entourage.

Sub SetFileAs()
    Dim olkItems As Outlook.Items, _
        olkContact As Object
    Set olkItems = Application.ActiveExplorer.CurrentFolder.Items
    For Each olkContact In olkItems
        With olkContact
            If .Class = olContact Then
                'Edit the next line to change how FileAs is populated'
                .FileAs = .LastName & ", " & .FirstName
            End If
        End With
    Set olkContact = Nothing
    Set olkItems = Nothing
    MsgBox "Finished", vbInformation + vbOKOnly, "Set FileAs"
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.