Map class has a method, ParseStreetAddress that parses a string into a valid street address represented as the StreetAddress class. The StreetAddress class has the Street, City, OtherCity, PostalCode, Region and Country properties that represent various parts of an address. The Value property of the StreetAddress class gives the full address as one string.

The following code shows how to parse a string into a valid address:

//Create an instance of the MapPoint application class
MapPoint.ApplicationClass app = new MapPoint.ApplicationClass();
//Get the Map object from the application object
MapPoint.Map map = app.ActiveMap;
//Parse the address
MapPoint.StreetAddress address =
map.ParseStreetAddress("498 Broad St, Seattle, WA, 98109");

//Now get the values from the
//StreetAddress properties
string streetName = address.Street;
string city = address.City;

To learn more about this topic and other related topics, please buy Programming MapPoint in .NET

0 comments