跳到主要内容

如何从Outlook中联系人的电话号码中删除国家/地区代码?

在“联系人”窗口中,单击 企业/主页/传真 /联络号码 电话号码前面的字段按钮以激活“检查电话号码”对话框,如下图所示,国家/地区代码将自动添加到电话号码之前。 但是,有时可能根本不需要区号,并且您想从所有电话号码中删除区号,如何处理? 请尝试以下解决方案:

Office 选项卡 - 在 Microsoft Office 中启用选项卡式编辑和浏览,让工作变得轻而易举
Kutools for Outlook - 通过 100 多个高级功能增强 Outlook,实现卓越效率
使用这些高级功能增强您的 Outlook 2021 - 2010 或 Outlook 365。 享受全面的 60 天免费试用并提升您的电子邮件体验!

箭头蓝色右气泡从联系人的电话号码中删除国家/地区代码

如果您只需要从联系人的一个电话号码中删除国家/地区代码,则可以按以下方式手动将其删除:

1.在 同事与员工 (或 联系我们)视图,单击 查看 > 变更检视 > 电话。 看截图:

2.双击以打开您的电话号码,您将从中删除国家/地区的联系人。

3.在打开的“联系人”窗口中,从指定电话中删除加号和国家/地区代码。 电话号码 部分,然后单击 联系我们 > 保存并关闭.

到目前为止,国家/地区代码已从指定的电话号码中删除,如下图所示:


箭头蓝色右气泡使用VBA从联系人的电话号码中删除国家/地区代码

如果您需要从Outlook中所有联系人的所有电话号码中删除国家/地区代码,建议您使用VBA轻松处理。

1.在 同事与员工 (或 联系我们)视图中,打开联系人文件夹,您将在其中删除所有联系人的国家代码。

2。 按 其他 + F11 同时按下两个键可以打开“ Microsoft Visual Basic for Applications”窗口。

3。 点击 插页 > 模块,然后将以下VBA代码粘贴到新的打开的模块脚本中。

VBA:从所有联系人的所有电话号码中删除国家/地区代码

Sub FixPhoneFormat()

 Dim oFolder As MAPIFolder
Set oFolder = Application.ActiveExplorer.CurrentFolder

 If Left(UCase(oFolder.DefaultMessageClass), 11) <> "IPM.CONTACT" Then
MsgBox "You need to select a Contacts folder", vbExclamation
Exit Sub
End If

Dim nCounter As Integer
nCounter = 0

Dim oItem
For Each oItem In oFolder.Items
Dim oContact As ContactItem

          If TypeName(oItem) <> "DistListItem" Then
Set oContact = oItem
With oContact
.AssistantTelephoneNumber = FixFormatUSPhone(.AssistantTelephoneNumber)
.Business2TelephoneNumber = FixFormatUSPhone(.Business2TelephoneNumber)
.BusinessFaxNumber = FixFormatUSPhone(.BusinessFaxNumber)
.BusinessTelephoneNumber = FixFormatUSPhone(.BusinessTelephoneNumber)
.CallbackTelephoneNumber = FixFormatUSPhone(.CallbackTelephoneNumber)
.CarTelephoneNumber = FixFormatUSPhone(.CarTelephoneNumber)
.CompanyMainTelephoneNumber = FixFormatUSPhone(.CompanyMainTelephoneNumber)
.Home2TelephoneNumber = FixFormatUSPhone(.Home2TelephoneNumber)
.HomeFaxNumber = FixFormatUSPhone(.HomeFaxNumber)
.HomeTelephoneNumber = FixFormatUSPhone(.HomeTelephoneNumber)
.ISDNNumber = FixFormatUSPhone(.ISDNNumber)
.MobileTelephoneNumber = FixFormatUSPhone(.MobileTelephoneNumber)
.OtherFaxNumber = FixFormatUSPhone(.OtherFaxNumber)
.OtherTelephoneNumber = FixFormatUSPhone(.OtherTelephoneNumber)
.PagerNumber = FixFormatUSPhone(.PagerNumber)
.PrimaryTelephoneNumber = FixFormatUSPhone(.PrimaryTelephoneNumber)
.RadioTelephoneNumber = FixFormatUSPhone(.RadioTelephoneNumber)
.TelexNumber = FixFormatUSPhone(.TelexNumber)
.TTYTDDTelephoneNumber = FixFormatUSPhone(.TTYTDDTelephoneNumber)

.Save

nCounter = nCounter + 1
End With
End If
Next

MsgBox nCounter & " contacts processed.", vbInformation

End Sub

Private Function FixFormatUSPhone(Phone As String) As String

Phone = Trim(Phone)
FixFormatUSPhone = Phone
If Phone = "" Then Exit Function
Dim prefix As String
prefix = Left(Phone, 1)

' Configured for US
' Enter the correct prefix here
Do While (prefix = "+" Or prefix = "1")

' if the prefix is 2 digits, change to 4;
' if 3 digits, change to 5
Phone = Mid(Phone, 3)
prefix = Left(Phone, 1)
Loop

' After we clean up the country code, we remove non-numeric characters
' Can be tweaked to change formatting, ie: change 202.555.1212 to 202-555-1212

 Phone = Replace(Phone, "(", "")
Phone = Replace(Phone, ")", "")
Phone = Replace(Phone, ".", "")
Phone = Replace(Phone, " ", "")
Phone = Replace(Phone, "-", "")

 FixFormatUSPhone = Phone

End Function

4。 按 F5 键或单击 Run按钮运行此VBA。

5.然后会弹出一个对话框,向您显示已处理了多少个联系人,请单击 OK 按钮关闭它。

现在,您将看到国家/地区代码已从所有联系人的所有电话号码中删除。 看截图:


箭头蓝色右气泡相关文章


最佳办公生产力工具

Kutools for Outlook - 超过 100 种强大功能可增强您的 Outlook

🤖 人工智能邮件助手: 具有人工智能魔力的即时专业电子邮件——一键天才回复、完美语气、多语言掌握。轻松改变电子邮件! ...

📧 电子邮件自动化: 外出(适用于 POP 和 IMAP)  /  安排发送电子邮件  /  发送电子邮件时按规则自动抄送/密件抄送  /  自动转发(高级规则)   /  自动添加问候语   /  自动将多收件人电子邮件拆分为单独的消息 ...

📨 电子邮件管理: 轻松回忆电子邮件  /  按主题和其他人阻止诈骗电子邮件  /  删除重复的电子邮件  /  高级搜索  /  合并文件夹 ...

📁 附件专业版批量保存  /  批量分离  /  批量压缩  /  自动保存   /  自动分离  /  自动压缩 ...

🌟 界面魔法: 😊更多又漂亮又酷的表情符号   /  使用选项卡式视图提高 Outlook 工作效率  /  最小化 Outlook 而不是关闭 ...

👍 一键奇迹: 使用传入附件回复全部  /   反网络钓鱼电子邮件  /  🕘显示发件人的时区 ...

👩🏼‍🤝‍👩🏻 通讯录和日历: 从选定的电子邮件中批量添加联系人  /  将联系人组拆分为各个组  /  删除生日提醒 ...

超过 100特点 等待您的探索! 单击此处了解更多。

了解更多       免费下载      购买
 

 

Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
+91 60024 92129, +91 60065 92433, +91 6202 829 537, +91 6203 755 915, +91 6204 259 651, +91 6207 216 259, +91 6209 023 134, +91 6232 456 267, +91 6235 691 325, +91 6263 257 978, +91 6263 845 800, +91 6266 107 625, +91 6266 376 594, +91 6266 384 728, +91 6280 820 003, +91 6281 474 533, +91 6284 313 048, +91 6289 752 279, +91 6295 233 987, +91 6305 544 139, +91 6305 562 486, +91 6306 311 209, +91 6306 386 697, +91 6307 439 745, +91 6352 442 999, +91 6353 295 836, +91 6354 886 422, +91 6355 080 896, +91 6355 150 955, +91 6358 267 338, +91 6360 945 697, +91 6360 971 578, +91 6360 996 047, +91 6361 017 625, +91 6361 161 705, +91 6362 272 097, +91 6362 416 590, +91 6362 931 344, +91 6363 514 848, +91 6364 472 912, +91 6366 080 543, +91 6366 862 676, +91 6370 377 433, +91 6375 291 478, +91 6377 101 680, +91 6377 234 266, +91 6377 787 860, +91 6379 731 040, +91 6379 898 610, +91 6380 895 878, +91 6382 288 674, +91 6382 538 352, +91 6383 599 030, +91 6390 226 455, +91 6396 147 183, +91 6396 898 290, +91 6396 913 882, +91 70026 40668, +91 70030 97346, +91 70037 91315, +91 70041 99885, +91 70077 00459, +91 70088 43393, +91 70139 18583, +91 70151 73797, +91 70162 80468, +91 70163 84772, +91 70215 25584, +91 70223 73946, +91 70223 86042, +91 70261 00777, +91 70281 24252, +91 70312 12290, +91 70338 71811, +91 70348 41296, +91 70415 89862, +91 70483 07028, +91 70564 29288, +91 70578 80895, +91 70611 23745, +91 70619 46794, +91 70635 71388, +91 70661 15004, +91 70684 42618, +91 70692 27254, +91 70694 59872, +91 70819 32191, +91 70926 80424, +91 70969 19196, +91 70972 88194, +91 72000 70714, +91 72005 08588, +91 72044 36977, +91 72044 43276, +91 72049 22644, +91 72054 75784, +91 72075 24526, +91 72094 15297, +91 72183 02668, +91 72230 46597, +91 72249 40943, +91 72328 52648, +91 72400 41795, +91 72492 19541, +91 72591 96605, +91 72678 35455, +91 72749 39201, +91 72819 41453, +91 72838 35806, +91 72879 76908, +91 72920 57758, +91 72970 86260, +91 73057 12295, +91 73071 40929, +91 73077 05470, +91 73199 30398, +91 73239 20547, +91 73381 01005, +91 73386 35465, +91 73389 98301, +91 73…
This comment was minimized by the moderator on the site
this works well, although i would like to understand how it works more as it puts brackets, where i dont really need then. I am in Australia.
My other issue is that somehow, somewhere, it is reverting back to all having the country code
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations