Accessing the address information of a waypoint

Anonymous
09-15-2003, 03:00 PM
In the application I am writing, I take a list of addresses from a customer database. I pass that list to MapPoint and optimize the route. Then, I need to read the individual addresses out of Mappoint so that I can write the addresses back to a text file in their new optimized order. With me so far?

So, here's my code that builds the route:

For intStopCounter = 0 To lstStops.ListCount - 1
oRte.Waypoints.Add oMap.FindAddressResults(stopData(intStopCounter).a dd1, _
stopData(intStopCounter).city, , _
stopData(intStopCounter).state, _
stopData(intStopCounter).zip)(1)
Next


and here's my export code.


intFileNumber = FreeFile
Open strFileName For Output As intFileNumber

For intStopCounter = 0 To oRte.Waypoints.Count - 1
strOut = Trim(Str(intStopCounter)) & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.Street & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.city & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.Region & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.PostalCode & "|"
strOut = Trim(Str(oRte.Waypoints.Item(intStopCounter).ListP osition))
Print #intFileNumber, strOut
Next

Close intFileNumber


I'm getting an error on the second line of the export, the line that tries to get the StreetAddress.Street value. The error I'm seeing is "The requested member of the collection does not exist. Use a valid name or index number."

Can someone tell me where I'm going wrong? Thanks in advance. I can't seem to figure out precisely what's wrong.

DWRoelands
09-15-2003, 03:02 PM
Whoops. Forgot to log in before posting. Apologies.

DWRoelands
09-15-2003, 03:23 PM
Man! I keep forgetting important information. This is Map Point 2002.

rbarthels
09-18-2003, 04:29 AM
Indicies from MP-Collections are starting from 1

Anonymous
05-12-2004, 12:36 PM
In the application I am writing, I take a list of addresses from a customer database. I pass that list to MapPoint and optimize the route. Then, I need to read the individual addresses out of Mappoint so that I can write the addresses back to a text file in their new optimized order. With me so far?

So, here's my code that builds the route:

For intStopCounter = 0 To lstStops.ListCount - 1
oRte.Waypoints.Add oMap.FindAddressResults(stopData(intStopCounter).a dd1, _
stopData(intStopCounter).city, , _
stopData(intStopCounter).state, _
stopData(intStopCounter).zip)(1)
Next


and here's my export code.


intFileNumber = FreeFile
Open strFileName For Output As intFileNumber

For intStopCounter = 0 To oRte.Waypoints.Count - 1
strOut = Trim(Str(intStopCounter)) & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.Street & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.city & "|"
strOut = oRte.Waypoints.Item(intStopCounter).Location.Stree tAddress.Region & "|"
strOut = oRte.Waypoints.Item(intStopCounter).<B style="color:black;background-color:#ffff66">Location.StreetAddress.PostalCode[/B] & "|"
strOut = Trim(Str(oRte.Waypoints.Item(intStopCounter).ListP osition))
Print #intFileNumber, strOut
Next

Close intFileNumber


I'm getting an error on the second line of the export, the line that tries to get the StreetAddress.Street value. The error I'm seeing is "The requested member of the collection does not exist. Use a valid name or index number."

Can someone tell me where I'm going wrong? Thanks in advance. I can't seem to figure out precisely what's wrong.

 
Web mp2kmag.com
mapforums.com