I'm trying to import a route into Mappoint from Access. I've figured out how to import the Pushpins using the Data Import Wizard but I don't see a wizard for importing a route using the pushpins. I'm pretty new to Visual Basic, but in reading the documentation that comes with Mappoint, I have been able to write code and create a route in Mappoint. Here is the code:

Sub WaypointTimes()
Dim oMap As MapPoint.Map
Set oMap = GetObject(, "MapPoint.Application").ActiveMap
oMap.Parent.PaneState = geoPaneRoutePlanner

With oMap.ActiveRoute.Waypoints
Dim oWP As MapPoint.Waypoint
.Add oMap.FindPushpin("STS921")
.Add oMap.FindPushpin("T3084")
.Add oMap.FindPushpin("T3448")
.Add oMap.FindPushpin("T3012")
.Add oMap.FindPushpin("T2099")
.Add oMap.FindPushpin("T2015")
.Add oMap.FindPushpin("T3458")
.Add oMap.FindPushpin("T1887")
.Add oMap.FindPushpin("T2956")
.Add oMap.FindPushpin("T1885")
.Add oMap.FindPushpin("T2840")
.Add oMap.FindPushpin("T4454")
.Add oMap.FindPushpin("T2608")
.Add oMap.FindPushpin("T4470")
.Add oMap.FindPushpin("T1911")
.Add oMap.FindPushpin("T3512")
.Add oMap.FindPushpin("STS921")

.Item(1).PreferredDeparture = "09:57 PM"
.Item(2).StopTime = 30 * geoOneMinute
.Item(3).StopTime = 15 * geoOneMinute
.Item(4).StopTime = 30 * geoOneMinute
.Item(5).StopTime = 30 * geoOneMinute
.Item(6).StopTime = 30 * geoOneMinute
.Item(7).StopTime = 15 * geoOneMinute
.Item(.StopTime = 30 * geoOneMinute
.Item(9).StopTime = 15 * geoOneMinute
.Item(10).StopTime = 30 * geoOneMinute
.Item(11).StopTime = 15 * geoOneMinute
.Item(12).StopTime = 15 * geoOneMinute
.Item(13).StopTime = 32 * geoOneMinute
.Item(14).StopTime = 15 * geoOneMinute
.Item(15).StopTime = 30 * geoOneMinute
.Item(16).StopTime = 15 * geoOneMinute
End With
oMap.ActiveRoute.Calculate
End Sub

The problem is that this is only one route out of twenty two routes that I need to import into Mappoint on a regular basis in order to get directions for our drivers for their daily routes.

Is it possible using Visual Basic in Access to import a route into Mappoint ? I have a query built that has the Pushpin Name, the Stop time and the stop order for each item in the route. Each item has a separate row in the query. From what I can tell, this is 'Waypoint' information that is needed to build a route in Mappoint.

It takes too much time to right now to manually build each route from scratch when a individual pushpin switches routes. It would be much faster to make the change in Access and then just import the new route into Mappoint.

Thanks,

Keith