Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

How to reset "File As" attribute after restore of exchange contacts using retrospect

One of our blackberry users just informed me that his outlook contact "Notes" field was truncated by his Blackberry.  He has over 3000 contacts.
I have performed a restore of his Contacts using EMC's Retrospect.  Unfortunately when you restore it the message is not restored to a "Contact" folder but rather to a "Message" format folder.  During the process all the contacts have lost their "File As" attribute.
How do I reset the or restore such that I do not lose this attribute?

Thanks
0
brian_appliedcpu
Asked:
brian_appliedcpu
1 Solution
 
brian_appliedcpuAuthor Commented:
This script will accomplish resetting the "File As" attribute to several options:

Public Sub ChangeFileAs()
    Dim objOL As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objContact As Outlook.ContactItem
    Dim objItems As Outlook.Items
    Dim objContactsFolder As Outlook.MAPIFolder
    Dim obj As Object
    Dim strFirstName As String
    Dim strLastName As String
    Dim strFileAs As String
    'On Error Resume Next

    Set objOL = CreateObject("Outlook.Application")
    Set objNS = objOL.GetNamespace("MAPI")
    Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)
    Set objItems = objContactsFolder.Items

    For Each obj In objItems
        'Test for contact and not distribution list
        If obj.Class = olContact Then
            Set objContact = obj

            With objContact
            ' Uncomment the  strFileAs line for the desired format

                'Lastname, Firstname (Company) format              
                ' strFileAs = .FullNameAndCompany
               
                'Firstname Lastname format
                ' strFileAs = .FullName
               
                'Lastname, Firstname format
                 strFileAs = .LastNameAndFirstName
               
                'Company name only
                ' strFileAs = .CompanyName
               
                'Companyname (Lastname, Firstname)
                ' strFileAs = .CompanyAndFullName
               
               .FileAs = strFileAs

                .Save
            End With
        End If

        Err.Clear
    Next

    Set objOL = Nothing
    Set objNS = Nothing
    Set obj = Nothing
    Set objContact = Nothing
    Set objItems = Nothing
    Set objContactsFolder = Nothing
End Sub

0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

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