Hi,
I'm working with MapPoint on Canadian data. I'm trying to match a Postal Code from an address using de FindAdressResult method. My VB code works well with US address and give me back the ZIP code without problem but with canadian data I can't get the Postal Code.
Is there a way to obtain the postal code from an address in Canada or is the data from the US more complete than the one from Canada ?
Here is the VB code I use to get the postal code from the address :
Option Explicit
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc As MapPoint.Location
Sub ReturnPostalCode()
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = False
objApp.UserControl = True
'Find an address
Set objLoc = objMap.FindAddressResults("4535 Papineau", "Montréal", , "QC", , geoCountryCanada)(1)
'Return the postal code of the parsed address
Excel.Cells(2, 1) = objLoc.StreetAddress.PostalCode
Excel.Cells(2, 2) = objLoc.StreetAddress.City
Excel.Cells(2, 3) = objLoc.StreetAddress.Street
MsgBox objLoc.StreetAddress.PostalCode
End Sub
Thanks
Remy