FindAddressResults method

Finds a collection of locations that are possible find matches to an address; similar to using the Address tab on the Find dialog box. While the parameters are each optional, you must pass at least one parameter. If a parameter is not supported for an address—for example, Region for an address in Germany—the parameter is ignored. Returns a FindResults collection.

Applies to

Objects:  Map

Syntax

object.FindAddressResults([Street], [City], [OtherCity], [Region], [PostalCode], [Country])

Parameters

Part Description
object Required. An expression that returns a Map object.
Street Optional String. The street name or street address to find.
City Optional String. The name of the city to find.
OtherCity Optional String. The name of the second city to find. Valid only for addresses in the United Kingdom.
Region Optional String. The name of the region to find, as follows:

the province name for addresses in Canada

the region name for addresses in Italy

the autonomia name for addresses in Spain

the constituent country name for addresses in the United Kingdom

the state name for addresses in the United States

PostalCode Optional String. The postcode, postal code, or ZIP Code to find.
Country Optional GeoCountry. The country to find. The following GeoCountry values are valid for the FindAddressResults method:
GeoCountry Description Version
geoCountryAustria Austria MapPoint Europe
geoCountryBelgium Belgium MapPoint Europe
geoCountryCanada Canada MapPoint North America
geoCountryDenmark Denmark MapPoint Europe
geoCountryFinland Finland (Helsinki) MapPoint Europe
geoCountryFrance France MapPoint Europe
geoCountryGermany Germany MapPoint Europe
geoCountryItaly Italy MapPoint Europe
geoCountryLuxembourg Luxembourg MapPoint Europe
geoCountryNetherlands Netherlands MapPoint Europe
geoCountryNorway Norway (Olso area) MapPoint Europe
geoCountryPortugal Portugal MapPoint Europe
geoCountrySpain Spain MapPoint Europe
geoCountrySweden Sweden MapPoint Europe
geoCountrySwitzerland Switzerland MapPoint Europe
geoCountryUnitedKingdom United Kingdom MapPoint Europe
geoCountryUnitedStates United States MapPoint North America

Remarks

For addresses in countries other than the United Kingdom, skip the OtherCity parameter. The example that follows skips the OtherCity parameter.

If an address is not already separated into the above parameters (for example, "One Microsoft Way, Redmond, WA 98033"), you can parse the address to these parameters using the ParseStreetAddress method on the Map object. For optimal results with the FindAddressResults method, you should parse the address by hand.

To generate results more quickly for addresses in the United States, add the Region parameter.

While only one parameter is required, the more parameters used, the more accurate the results returned.

To return an assessment of how well the results produced by the FindAddressResults method match the input strings, use the ResultsQuality property of the FindResults collection, or check the Type, StreetAddress, or PlaceCategory property of a Location object.

To open the Find dialog box for user input, use the ShowFindDialog method on the Map object.

Example

    Sub FindAddressSearch()
  Dim objApp As New MapPoint.Application
  Dim objFindResults As MapPoint.FindResults

  'Set up application   objApp.Visible = True   objApp.UserControl = True
  'Output first result of find search   Set objFindResults = objApp.ActiveMap.FindAddressResults("One Microsoft Way", "Redmond", , "WA", , geoCountryUnitedStates)   MsgBox "The first item in the find list is: " _     + objFindResults.Item(1).Name
  End Sub

Note  This sample code is specific for use in MapPoint North America; it is for illustration purposes only.