Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 4 of 4

Version 2001 Programatic manipulation

This is a discussion on Version 2001 Programatic manipulation within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have MapPoint 2001, Can I manipulate this w/ VB(A) to retrieve the Lat, Lon, Distance, route Milesage etc. I ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002

    Version 2001 Programatic manipulation

    I have MapPoint 2001, Can I manipulate this w/ VB(A) to retrieve the Lat, Lon, Distance, route Milesage etc. I am reasonably proficient w/ the various'flavors" of VB(A) and VB itself, but have noted the numerous recommendations to upgrade to at least ver "X" (all well beyond 2001). Unfortunatly, I would be hard pressed to afford the cost as I am retired and have a limited income. The obnly 'reference' I see within the help files concerns generating a com add in to instantiate as a menu item. It doesn't even begin to list the data elements which could then be manipulated via the menu item (re the above)

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002


    Since the original posting, I have struggled to get through the exercise. I have browsed through over 1/2 of the messages and articles posted here in, extracting several to numerous routines and combining them with the (skimpy?) examples from (MapPoint) Help. The Calc Position routine with some help file stufff ... ffff gets a map open (even on screen! - Which I do not really need), and -given a LITERAL for the place to find setting a location object, it will return (calculate) a (single) Lat & Lon. I cannot sem to devise any way to have FIND use a calculated string or string variable. If any one can suggest WHAT the (*&!#$^(*&#^$(A@^( I am doing wrong it would be SISNCERELY appreciated. It would be almost sincerely appreciated If you could even DEFINITIVELY state that Find CANNOT accept anything BUT the literal argument (although THAT seems to make the method of the object USELESS!!!! (?)

    Public Function basOpenMap(MapPath As String) As Boolean
        'Michael Red    11/5/04 First try from Help Exapmples
        Dim objMapApp As MapPoint.Application
        Dim objMap As MapPoint.Map
        Dim objRs As MapPoint.Recordset
        Dim objData As MapPoint.DataSet
        Dim objLoc As MapPoint.Location
        Dim PPinLoc As MapPoint.Location
        Dim ILat As Double
        Dim iLon As Double
        Set objMapApp = New MapPoint.Application
        Set objMap = objMapApp.NewMap
        Dim Idx As Integer
        objMap.SaveAs objMapApp.DefaultFilePath & "\Map.Ptm", geoFormatMap
        Set objMap = objMapApp.OpenMap(objMapApp.DefaultFilePath & "\" & MapPath & ".PTM")
        Set objRs = objMapApp.OpenMap(objMapApp.DefaultFilePath & "\" & MapPath & ".PTM") _
        Set objData = objMap.DataSets("qrySelFlZips")
        'From LITERAL ONLY
        Set objLoc = objMap.Find("Tampa, FL")
        Call CalcPos&#40;objMap, objLoc, ILat, iLon&#41;        '<-Works
        Debug.Print ILat, iLon
        'From ana attempt to get the several via the string VARIABLE
        While Idx < objData.RecordCount
            Set PPinLoc = objMap.Find&#40;Chr&#40;34&#41; & objRs.Fields&#40;1&#41; _
                         & ", FL" & Chr&#40;34&#41;&#41;
            Call CalcPos&#40;objMap, PPinLoc, ILat, iLon&#41;   '<-Works NOT
            Debug.Print objRs.Pushpin.Name, objRs.Fields&#40;1&#41;, ILat, iLon     'Gives Zip Code &#40;PK&#41; and Name
            Idx = Idx + 1
    End Function

  3. #3
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Its good advice to upgrade to MapPoint 2002. It will be frustrating trying to get stuff to work and it will be hard to help you with 2001. (I don't even have a copy anymore I dont think) Everyone uses 2002 or 2004. The big difference in 2004 is updated data. You may be able to get a copy of MapPoint 2002 on ebay for a good price.

    I did notice in you code sample that you opened/created the map 4 times?

    Set objMap = objMapApp.NewMap 
    Set objMap = objMapApp.OpenMap&#40;objMapApp.DefaultFilePath & "\" & MapPath & ".PTM"&#41; 
    Set objRs = objMapApp.OpenMap&#40;objMapApp.DefaultFilePath & "\" & MapPath & ".PTM"&#41; _ .DataSets&#40;"qrySelFlZips"&#41;.QueryAllRecords

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002

    Thanks for at least SOME response. By continued 'due duilengence', I am (S L O W L Y) getting somewhere. I can currently ge a large percentage of the points to work with a string variable using the FIND method. Approx 15% still baffle me. Using the "Find Dialog, I can enter the City name and State and ye olde (and apparently decripit?) MapPoint 2001 goes to the city. Putting the "Same" info in programatically with the string variable, the Finf METHOD fails to generate a Location object. I think much of my earlier difficulty in the use of the string var was the weird, non-standard error handling from MapPooint (at least ver '01). When the methods fail, they do not error, but set the opbject to nothing, but the Distance method fails and returns an actual error. I did eventually find [/b]Is Nothing and can trap the occurance of the failure to find and prevent (ByPass) the call to CalcPos.

    Alas. Alack and Awry I still can't figure out WHY the find method fails -particularly so often. My first thought was that find was not able to (uniquely) resolve the City-State in htese instances, however using hte text box entry shows tha somewhere over (or at least near) 90% of hte entries return multiple locations, so this appears to not be the basic issue. I haven't yet attempted to Include the Zip code as part of location to Find, however this would be -at best- problematical, as Zip Codes are subject to change and I do not seem to have a reliable (and FREE) source enyway. I MAY go back and re-try t he FinAddress method, but so far at least is is even MORE frostrating than Find, as it SEEMS LIKE the "Street" argument is required. This might be good for a greater level of detail, but I'm only trying to get a general set of locations (to Zip code today, perhaps to census tracts later), not specific street addresses (e.g. not a single building), so I do not even have street names, or bulding / lot information to try this with.

    I am just starting to manipulate MapPoint, and the code I posted is the progressive results of attempting to combine the various snippets from MApPoing (programming) help (Properties and Methods). I haven't quite yet slowed down enough to get the understanding of the differences in the various methods of instantiating the specific Map. I will review the code a bit and see if I can reduce the number of occurances of instantiating map, In particular, I would like to avoid instantiating the application as a visible object (Window), ofr at least destroy it when the routine(s) are complete.

    Thanks, again, for responmding,

    Michael Red

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I am using mappoint version 2001. And I want to ha....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 06-11-2002, 01:11 PM
  2. i have two questions: i am using mappoint 2001 an....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-03-2002, 01:01 PM
  3. Quick Review - Safe Software Feature Manipulation Engine for
    By Anonymous in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 01-31-2002, 10:48 PM
  4. I have Microsoft Mappoint 2001 and I am trying to ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-25-2001, 03:48 AM
  5. We are using MapPoint 2001 but hope you can still ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-25-2000, 11:24 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84