Microsoft KB Archive/166333

= OL97: How to Correct Formatting and Parsing of Imported Contacts =

Article ID: 166333

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Outlook 97 Standard Edition

-



This article was previously published under Q166333



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://support.microsoft.com/directory/

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

Design a New Post Form
 Open a new post message:  On the File menu of Inbox, point to New, and then click "Post in This Folder." On the Tools menu of the new Post form, click Design Outlook Form.  Insert a Command Button on the new form:  Click the (P.2) tab to go to a blank page on the form.</li> On the Form menu, click Control Toolbox.</li> In the Toolbox, click CommandButton and drag it to the blank form page.</li> Right-click CommandButton1 and click Properties.</li> In the Caption window type "Correct Contacts" and click OK.</li></ol> </li> Insert VBScript code:  On the Form menu, click View Code to open the Script Editor.</li>  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 </li> On the File menu in Script Editor, click Close to return to the form.</li></ol> </li> Rename the second page (p.2) tab and publish the new form:  On the Form menu, click Rename Page.</li> Type a name for this page such as, Correct Contacts, and click OK.</li> On the File menu, click Publish Form As.</li> In the "Form Name" box, type a name for your new form such as Correct Contacts and then click the "Publish In" button.</li> Click Forms Library and click Personal Forms in the drop-down list.</li> <li>Click OK and click Publish.</li> <li>Close the message without saving.</li></ol> </li></ol>

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.

<div class="references_section">