OL2000: How to Programmatically Add '+1' to Contact Fax Numbers

ID: Q197726


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



NOTE: These procedures only apply if you have installed Outlook with the Internet Mail Only (IMO) option. To determine your installation type, on the Help menu click About Microsoft Outlook. In About Microsoft Outlook you should see "Internet Mail Only" if you have the Internet Mail Only option installed.

SUMMARY

The Symantec Fax Starter Edition program, installed with Microsoft Outlook (IMO), requires a +1 at the beginning of the fax numbers in order to dial correctly. If you are dialing from a contact fax number, you must insert the +1 into the fax number for the contact record.

This article outlines a procedure for using VB Script to insert the +1 into all the contact record fax numbers programmatically.


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
For more information about getting help with Visual Basic Scripting, please see following article in the Microsoft Knowledge Base:
Q146636 OL2000: Questions About Custom Forms and Outlook Solutions
Follow these steps to create a new post form to modify the contact record fax numbers.

Design a New Post Form

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


  2. On the Tools menu of the new Post form, point to Forms and click Design This Form.


  3. Click the (P.2) tab to go to a blank page on the form, and on the Form menu, click Control Toolbox.


  4. Click CommandButton and drag it to the blank form page.


  5. Right-click CommandButton1, click Properties, and in the Caption window type Correct Fax Numbers and click OK.


  6. On the Form menu, click View Code and 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)
          If Left(MyItem.HomeFaxNumber,2)<>"+1" and _
          MyItem.HomeFaxNumber<> "" Then
          MyItem.HomeFaxNumber="+1" & MyItem.HomeFaxNumber
        End If
          If Left(MyItem.BusinessFaxNumber,2)<>"+1" and _
          MyItem.BusinessFaxNumber<> "" Then
          MyItem.BusinessFaxNumber="+1" & MyItem.BusinessFaxNumber
        End If
          If Left(MyItem.OtherFaxNumber,2)<>"+1" and _
          MyItem.OtherFaxNumber<> "" Then
          MyItem.OtherFaxNumber="+1" & MyItem.OtherFaxNumber
        End If
        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 


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


  8. On the Form menu, click Rename Page and type a name for this page such as Correct Fax Numbers, and click OK.


Publish the New Form

  1. On the Tools menu, point to Forms and click Publish Form As.


  2. In the "Look in" list click to select Personal Forms Library. Type a name for your new form such as, Correct Fax Numbers and then click Publish.


  3. On the File menu, click Close, and then click No to close without saving.


To Use Your New Form

  1. Click to select the folder containing the contacts you want to correct.


  2. On the File menu, point to New and click Choose Form.


  3. In the Look In list, click to select Personal Forms Library, click your new form and click Open.


  4. On the second page tab, click the button ("Correct Fax Numbers" from earlier in this article) to correct the fax numbers in the current folder.


NOTE: This only affects fax numbers in the current folder.

Additional query words: OL2K

Keywords : kbdta FmsHowto ScriptHowTo
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto


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