spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2013
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2013

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials
MapPoint

Map Visitors

  MAPPOINT Q & A  

Top | Post New Question | Read All | MP2K Asks Microsoft

569 chris - January 3, 2002

I have downloaded the database example where you have two addresses in a db and then it calculates and pastes the map and directions back into access but can you just get it to paste the cost of the journey or just the mileage instead of teh directions. Happy New year.

Answer:

To determine cost for a route, you can use the Cost property of the ActiveRoute object. For example:

    'oMap references your current MapPoint Map
    MsgBox "The cost for this route is " & oMap.ActiveRoute.Cost
    MsgBox  "The distance for this route is " & oMap.ActiveRoute.Distance
To programmatically set the driving options, use the Driver Profile object of the ActiveRoute object. For example:

  
  'Set the DrivingCostUnits to fixed cost based on distance and use 
  'DrivingCost to set the cost at $.80 per distance unit
  objRoute.DriverProfile.DrivingCostUnits = geoCostBasedOnDistance
  objRoute.DriverProfile.DrivingCost = 1.25  
  'Cost in dollars per distance unit. Mostly miles.
  objRoute.Calculate  'recalculate the route
You can get more information by opening MapPoint, going to Help, selecting Visual Basic Reference, and clicking on the ActiveRoute or DriverProfile objects. - Chris Gebhardt

Post New Answer / Follow-up


Google
 
MP2Kmag Internet


 Recent Discussion
 Resources


Want Your Site To Appear Here?

   © 1999-2012 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009/2010/2011/2013 are either trademarks or registered trademarks of Microsoft.