Is there an Outlook Add-In that can tell you the time or time zone for a contact based on their area code?
I'm not aware of any addins, but it's a great idea. Until then, adding a field to contacts to record the time zone is one option, although you'd need to add the time zone yourself.
You can use a macro to grab the postal code and look up the time zone. While it's not perfect, it is useful for anyone who wants to identify the time zone a person lives in.
I think using the postal code would be better than the phone number's area code, at least here in the US. Thanks to number portability, the person may not be living in the same region the area code is assigned to.
The following two URLs work for US addresses. Any site that includes the zip code in the URL can be used. To use, replace the number with the zip code string. Melissadata's URL accepts the full telephone number or just the area code, if you prefer to use it.
At this time, the code opens a web page containing the time zone and other information.
I'm working on scraping the page and grabbing just the time zone from the page, then displaying it in a message box, writing it to the notes field, or to a custom field.
To use, select a contact and run the macro.
Get the time zone macro
Sub GetContactTimeZone() Dim strURL As String Dim oApp As Object Dim strAddress As String Set oApp = CreateObject("InternetExplorer.Application") If TypeName(ActiveExplorer.Selection.Item(1)) = "ContactItem" Then Set oContact = ActiveExplorer.Selection.Item(1) strAddress = oContact.MailingAddressPostalCode ReplaceSpaces strAddress strURL = "http://www.melissadata.com/lookups/ZipCityPhone.asp?InData=" & strAddress & "=Search" oApp.Navigate (strURL) oApp.Visible = True 'wait for page to load before passing the web URL Do While oApp.Busy DoEvents Loop End If Set oApp = Nothing End Sub Private Sub ReplaceSpaces(strAddress As String) strAddress = Replace(strAddress, " ", "-") End Sub
How to use macros
First: You will need macro security set to low during testing.
To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security.
After you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Open the VBA Editor by pressing Alt+F11 on your keyboard.
To put the code in a module:
- Right click on Project1 and choose Insert > Module
- Copy and paste the macro into the new module.
More information as well as screenshots are at How to use the VBA Editor