MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Accessing the address information of a waypoint

This is a discussion on Accessing the address information of a waypoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; In the application I am writing, I take a list of addresses from a customer database. I pass that list ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-15-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Accessing the address information of a waypoint

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:
Code:
    For intStopCounter = 0 To lstStops.ListCount - 1
        oRte.Waypoints.Add oMap.FindAddressResults(stopData(intStopCounter).add1, _
            stopData(intStopCounter).city, , _
            stopData(intStopCounter).state, _
            stopData(intStopCounter).zip)(1)
    Next
and here's my export code.

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.StreetAddress.Street & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).Location.StreetAddress.city & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).Location.StreetAddress.Region & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).Location.StreetAddress.PostalCode & "|"
        strOut = Trim(Str(oRte.Waypoints.Item(intStopCounter).ListPosition))
        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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-15-2003
Junior Member
White Belt
 
Join Date: Sep 2003
Posts: 2
Send a message via AIM to DWRoelands
Whoops. Forgot to log in before posting. Apologies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-15-2003
Junior Member
White Belt
 
Join Date: Sep 2003
Posts: 2
Send a message via AIM to DWRoelands
Man! I keep forgetting important information. This is Map Point 2002.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 09-18-2003
Member
Green Belt
 
Join Date: Nov 2002
Posts: 52
Indicies from MP-Collections are starting from 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-12-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Re: Accessing the address information of a waypoint

Quote:
Originally Posted by Anonymous
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:
Code:
    For intStopCounter = 0 To lstStops.ListCount - 1
        oRte.Waypoints.Add oMap.FindAddressResults(stopData(intStopCounter).add1, _
            stopData(intStopCounter).city, , _
            stopData(intStopCounter).state, _
            stopData(intStopCounter).zip)(1)
    Next
and here's my export code.

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.StreetAddress.Street & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).Location.StreetAddress.city & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).Location.StreetAddress.Region & "|"
        strOut = oRte.Waypoints.Item(intStopCounter).<B style="color:black;background-color:#ffff66">Location.StreetAddress.PostalCode[/b] & "|"
        strOut = Trim(Str(oRte.Waypoints.Item(intStopCounter).ListPosition))
        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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
accessing, address, information, waypoint


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Saving "Place or Address" Information blksheepram MapPoint 2006/2009 Discussion 0 07-27-2005 12:18 PM
Accessing Map Point amitsh MapPoint 2006/2009 Discussion 0 03-02-2004 07:59 AM
address from waypoint starbuck MapPoint 2006/2009 Discussion 7 11-18-2003 08:04 AM
Getting address information of location object in delphi? Sheridan MapPoint 2006/2009 Discussion 1 03-07-2003 08:37 AM
How do I, or can I update address information in M.... Anonymous MapPoint 2006/2009 Discussion 1 07-12-2002 11:41 AM


All times are GMT -5. The time now is 12:58 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59