My web stats show that visitors to this site have come from 215 countries. Which is amazing because the U.S. State Department recognizes only 194 official countries.
Here are the "countries" that haven't sent even one lousy hit.
French Guiana

This territory is actually a part of France, but Google doesn't seem to count hits from this place as being part of France. There aren't many people here, and I'm sure they have better things to do than look for VBA code samples.
Western Sahara

A disputed territory in west Africa, this area has a very small population (there are as many people in Staten Island). Maybe if I came up with an oil-finding spreadsheet, or something for planning war strategy, they might visit.
Chad

Another country that seems to have no use for Outlook automation.
Central African Republic

I don't see any reason why this isn't listed as a country, except maybe for the political instability. Another place with better things to do.
North Korea

The aptly-named "hermit kingdom". I assume these folks don't have permission to visit "Western" websites.
Somalia

I'm curious to know if anyone out there gets hits from this country. With no stable national government, I can easily see why not.
Turkmenistan

The socialist government probably prevents visiting many Western websites.
Svalbard (Norway)

This set of islands north of the Arctic Circle is a territory of Norway, but looks like it's listed separately by Google. It spends so much time in daylight (and darkness), I can't imagine why there aren't any hits from here (and why there aren't more children). But according to the CIA, all they have are telephones, and since most of the population is busy mining coal, that's probably what they are spending their time on.
I hope that people realize this is meant as humor. I'm not trying to exploit the poor plight of the people living in these countries for my own benefit, like some people.
Getting Country Maps
Lonely Planet formats their image URLs in such a way that it's possible to programmatically calculate the URL for the image we want. So if you need maps, consider some "creative borrowing" from them. Don't worry, in the next post we'll discuss static maps using Google's Map API, so you won't feel so dirty.
The base URL is
http://www.lonelyplanet.com/maps/
The full format is
http://www.lonelyplanet.com/maps/[region]/[country]/map_of_[country].jpg
Calculate Region
There are eight regions:
- http://www.lonelyplanet.com/maps/africa/
- http://www.lonelyplanet.com/maps/asia/
- http://www.lonelyplanet.com/maps/central-america/
- http://www.lonelyplanet.com/maps/europe/
- http://www.lonelyplanet.com/maps/middle-east/
- http://www.lonelyplanet.com/maps/north-america/
- http://www.lonelyplanet.com/maps/pacific/
- http://www.lonelyplanet.com/maps/south-america/
So all we need to do is choose the region from a list, make it lower case and replace spaces with hyphens.
Function GetRegion(regionName As String) As String GetRegion = LCase$(Replace(regionName, " ", "-")) End Function
Calculate Country Name
Just like the region, the country name is a lower cased, hyphenated version of the country name.
Function GetCountry(countryName As String) As String GetCountry = LCase$(Replace(countryName, " ", "-")) End Function
So if I want a map of Canada, here's the URL:
http://www.lonelyplanet.com/maps/north-america/canada/map_of_canada.jpg

If your URL does not return a map, check their website to make sure you are spelling the name of the country as they list it. For example, some places spell it "Guyana" while others use "Guiana".
City Maps
We can also drill down to select cities. Check Lonely Planet's website to see what city maps are available. The format of the URL is
http://www.lonelyplanet.com/maps/[region]/[country]/[city]/map_of_[city].jpg
The city is the same format as country and region, i.e.
Function GetCity(cityName As String) As String GetCity = LCase$(Replace(cityName, " ", "-")) End Function
So here's a map of Montreal, Canada:
http://www.lonelyplanet.com/maps/north-america/canada/montreal/map_of_montreal.jpg

What to do with the images?
In Get that Gravatar! I mentioned two methods for displaying graphics. Either download them to the local computer for caching (I prefer the temp folder for this) or display them in a WebBrowser control.
The WebBrowser control has the benefit of not requiring you to take the additional step of storing the image, but I hate the "disabled scrollbar" look. And since we're not exactly asking for permission to use these images, downloading a copy and storing it locally seems like the safer option to avoid detection.





I have had visitors from 209 "countries", three from Turkmenistan! Chad: 1. The other "countries" you refered to: 0!
That's okay, JP! Those countries are quite impossible to get links from anyway, especially North Korea. At least you've got plenty of visits from more than 200 countries now. That's something!