'resolve a weather location name and add it if it does not yet exist
strLocationToAdd =
"Санкт Петербург"
set
Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
set
WeatherServices = Session.WeatherServices
WeatherServices.LanguageCodeID =
"de-de"
'return data in German
set
locations = WeatherServices.ResolveLocation(strLocationToAdd)
Debug.Print
"Found "
& locations.Count &
" matching locations for "
& strLocationToAdd &
":"
for
each
objLocation
in
locations
Debug.Print
objLocation.Name
next
if
locations.Count > 0
Then
set
objNewLocation = locations(1)
'pick the first location
if
(WeatherServices.Locations.Item(objNewLocation.Code)
Is
Nothing)
Then
Debug.Print
"Adding location "
& objNewLocation.Name
WeatherServices.Locations.Add(objNewLocation)
WeatherServices.Save
End
If
End
If
|