[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1453
  • Last Modified:

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.

Thanks
0
Undisputed
Asked:
Undisputed
1 Solution
 
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
                .Save
            End If
        End With
    Next
    Set olkContact = Nothing
    Set olkItems = Nothing
    MsgBox "Finished", vbInformation + vbOKOnly, "Set FileAs"
End Sub

Open in new window

0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now