OL98: How to Programmatically Add '+1' to Contact Fax NumbersID: Q193981
|
The WinFax Starter Edition fax 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.
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.aspThis article assumes that you are familiar with Visual Basic Scripting and with creating Microsoft Outlook forms using the programming tools provided with Outlook. For more information about getting help with Visual Basic Scripting, please see following article in the Microsoft Knowledge Base:
Q166368 OL97: How to Get Help Programming with OutlookFollow these steps to create a new post form to modify the contact record fax numbers.
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
Additional query words: 98
Keywords : FmsHowto ScriptHowTo
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: August 3, 1999