OL97: How to Correct Formatting and Parsing of Imported Contacts

ID: Q166333


The information in this article applies to:
  • Microsoft Outlook 97


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:


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


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


  2. Insert a Command Button on the new form:


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


    2. On the Form menu, click Control Toolbox.


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


    4. Right-click CommandButton1 and click Properties.


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


  3. Insert VBScript code:


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


    2. 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 


    3. 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:


    1. On the Form menu, click Rename Page.


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


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


    4. In the "Form Name" box, type a name for your new form such as Correct Contacts and then click the "Publish In" button.


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


    6. Click OK and click Publish.


    7. 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:

Q164401 OL97: Fields Missing Inserting a Contact into Word
Q164408 OL97: Imported Fax Numbers May Not Work in Outlook
Q164477 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:

Q166368 OL97: How to Get Help Programming with Outlook
Q170783 OL97: Q&A: Questions about Customizing or Programming Outlook

Additional query words: OutSol OutSol97 parse format

Keywords :
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 1, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.