OL97: How to Correct Formatting and Parsing of Imported Contacts

ID: Q166333

The information in this article applies to:

SYMPTOMS

Importing contacts into Microsoft Outlook 97 results in incorrectly formatted or parsed address and fax number fields. Although the information may look correct when viewed in an Outlook form, it may result in erratic behavior when other routines or programs use the information.

This article outlines a procedure using VBScript to correct this.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Outlook 97 for Windows. This problem was corrected in Microsoft Outlook 97 version 8.02 for Windows.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/default.asp

Follow these steps to create a new post form to correct the imported contact records.

Design a New Post Form

1. Open a new post message:

    a. On the File menu of Inbox, point to New, and then click "Post in 
       This Folder."

    b. On the Tools menu of the new Post form, click Design Outlook
       Form.

2. Insert a Command Button on the new form:

    a. Click the (P.2) tab to go to a blank page on the form.

    b. On the Form menu, click Control Toolbox.

    c. In the Toolbox, click CommandButton and drag it to the
       blank form page.

    d. Right-click CommandButton1 and click Properties.

    e. In the Caption window type "Correct Contacts" and click OK.

3. Insert VBScript code:

    a. On the Form menu, click View Code to open the Script Editor.

    b. In the Script Editor, type or copy the following code:

     Sub CommandButton1_Click()
     'This will only work on contacts in the CURRENT folder
     Set CurFolder=Application.ActiveExplorer.CurrentFolder
     If CurFolder.DefaultItemType=2 Then
       MsgBox "This process may take some time. You will be notified" & _
       " when complete.",,"Contact Tools Message"
       Set MyItems=CurFolder.Items
         For i = 1 to MyItems.Count
           Set MyItem=MyItems.Item(i)
      MyItem.MailingAddressStreet=MyItem.MailingAddressStreet
      MyItem.MailingAddressCity=MyItem.MailingAddressCity
      MyItem.MailingAddressState=MyItem.MailingAddressState
      MyItem.MailingAddressPostalCode=MyItem.MailingAddressPostalCode
      MyItem.MailingAddressPostOfficeBox=MyItem.MailingAddressPostOfficeBox
      MyItem.CompanyName=MyItem.CompanyName
      MyItem.HomeFaxNumber=MyItem.HomeFaxNumber
      MyItem.BusinessFaxNumber=MyItem.BusinessFaxNumber
      MyItem.OtherFaxNumber=MyItem.OtherFaxNumber
      MyItem.EMail1Address=MyItem.EMail1Address
      MyItem.EMail2Address=MyItem.EMail2Address
      MyItem.EMail3Address=MyItem.EMail3Address
      MyItem.Body=MyItem.Body
      MyItem.Sensitivity=MyItem.Sensitivity
           MyItem.Save
         Next
      MsgBox "Done!",64,"Contact Tools Message"
     Else
      MsgBox "The current folder is not a Contact folder.",64,"Contact" & _
     " Tools Message"
     End If
     End Sub

    c. On the File menu in Script Editor, click Close to return to the 
       form.

4. Rename the second page (p.2) tab and publish the new form:

    a. On the Form menu, click Rename Page.

    b. Type a name for this page such as, Correct Contacts, and
       click OK.

    c. On the File menu, click Publish Form As.

    d. In the "Form Name" box, type a name for your new form such as
       "Correct Contacts" (without the quotation marks) and then click the
       "Publish In" button.

    e. Click Forms Library and click Personal Forms in the drop-down list.

    f. Click OK and click Publish.

    g. Close the message without saving.

To Use Your New Form

1. Navigate to the folder containing the contacts you want to correct.

2. On the Contacts menu, click Choose Form.

3. In the Personal Forms list, click your new form and click OK.

4. Click the second page tab and click the button (Correct Contacts from

   Step 2e above) to correct the contacts in the current folder.

NOTE: This only affects contact names in the current folder.

REFERENCES

For information about manually correcting individual records, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q164401
   TITLE     : OL97: Fields Missing Inserting a Contact into Word

   ARTICLE-ID: Q164408
   TITLE     : OL97: Imported Fax Numbers May Not Work in Outlook

   ARTICLE-ID: Q164477
   TITLE     : OL97: Address Displays Incorrectly on Imported Contacts

For more information about creating solutions with Microsoft Outlook 97, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q166368
   TITLE     : OL97: How to Get Help Programming with Outlook

   ARTICLE-ID: Q170783
   TITLE     : OL97: Q&A: Questions about Customizing or
               Programming Outlook

Additional query words: OutSol OutSol97 parse format
Keywords          : kbcode kbdta 
Version           : WINDOWS:97
Platform          : WINDOWS
Issue type        : kbprb

Last Reviewed: April 16, 1999