Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove +1 from phone numbers (Outlook 2000)

    Someone deliberately added +1 to all local phone numbers, but now wants the +1 removed. He did not use the "automatically add country code to local phone numbers" option, but changed each contact individually. Is there a way to remove the +1 from local numbers in some automatic fashion so that he (i.e., his secretary) does not have to open and update each contact individually?

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    Many apologies, as I'm pressed for time, but before the secretary gets put into the pressure cooker, I'm pretty sure that this can be done by code. Hopefully someone will come up with some pre-made code snippets before I resurface. Bit out of touch with current local dialling rules in the US. Does a + get recognised before the area code, or do you need a 0, and did they put a space or a hyphen or nothing between the 1 and the area code?
    Gre

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    Still waiting? See if this does what you want. It matches "+1 " as the first three characters of four different phone numbers. It removes those first three characters and saves the change, sweeping through the entire contacts folder in one go. You could add checks for home and "other" numbers if they are an issue.
    <pre>Sub DeletePlusOne()
    'Delete +1 from all contacts' phone numbers
    'Does not ask for confirmation on individual changes
    Dim aContact As ContactItem
    If MsgBox("This will scan the current folder. Okay?", vbQuestion + vbYesNo) _
    = vbNo Then Exit Sub
    'next line will err if not in a contact folder
    For Each aContact In ActiveExplorer.CurrentFolder.Items
    If Left(aContact.BusinessTelephoneNumber, 3) = "+1 " Then
    aContact.BusinessTelephoneNumber = _
    Right(aContact.BusinessTelephoneNumber, _
    Len(aContact.BusinessTelephoneNumber) - 3)
    aContact.Save
    End If
    If Left(aContact.BusinessFaxNumber, 3) = "+1 " Then
    aContact.BusinessFaxNumber = _
    Right(aContact.BusinessFaxNumber, _
    Len(aContact.BusinessFaxNumber) - 3)
    aContact.Save
    End If
    If Left(aContact.Business2TelephoneNumber, 3) = "+1 " Then
    aContact.Business2TelephoneNumber = _
    Right(aContact.Business2TelephoneNumber, _
    Len(aContact.Business2TelephoneNumber) - 3)
    aContact.Save
    End If
    If Left(aContact.CompanyMainTelephoneNumber, 3) = "+1 " Then
    aContact.CompanyMainTelephoneNumber = _
    Right(aContact.CompanyMainTelephoneNumber, _
    Len(aContact.CompanyMainTelephoneNumber) - 3)
    aContact.Save
    End If
    Next
    MsgBox "Done!"
    End Sub</pre>

    Hope this helps.

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    Thank you very much! I'll give it a go.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    I get a "type mismatch" error when running this code on the Contacts folder. I know next to nothing about vb, so I'm having trouble figuring out the problem. Any help appreciated.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    If you're actually viewing the contacts, it should work. My default view is the little cards, if that makes any difference (it shouldn't). If you click Debug..., which line is highlighted?

  7. #7
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Remove +1 from phone numbers (Outlook 2000)

    Could you not do an export to csv
    Run a find and replace to remove the +1 in Excel
    Import back in.
    ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •