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

Ctrl+T (Data -> Territories...) programatically MapPoint

This is a discussion on Ctrl+T (Data -> Territories...) programatically MapPoint within the MapPoint Desktop Discussion forums, part of the Map Forums category; I've got Excel, Word and MapPoint working quite nicely together, plotting territories from Excel and then pasting the map into ...

  1. #1
    SheepWorrier is offline Junior Member White Belt
    Join Date
    Oct 2004
    Posts
    7

    Ctrl+T (Data -> Territories...) programatically MapPoint

    I've got Excel, Word and MapPoint working quite nicely together, plotting territories from Excel and then pasting the map into Word. However, there's one thing I can't get it to do automatically:

    When Excel has plotted the territories (by UK Postcode Sectors) into MapPoint - MapPoint is in the standard Legend and Overview mode, which doesn't show the Postcode Sectors. What you can do manually is press Ctrl+T or click Data -> Territories... - then MapPoint switches to Territory Manager and the Postcode Sectors are displayed. Then the macro continues and pastes into Word etc.

    Any ideas how to switch into Territory Manager in VBA?

    I've tried:

    With objApp.ActiveMap.DataSets
    szconn = "C:\Mapping Data.xls" & "!Sheet1!A:B"
    Set oDS = .ImportTerritories(szconn, , geoCountryUnitedKingdom, , geoImportExcelA1)
    Application.DisplayAlerts = False
    Set oDS = .ShowImportTerritoriesWizard
    Application.DisplayAlerts = True
    End With

    but keep getting an error that the Import Territories Wizard cannot run because there is already a DataSet present.

  2. #2
    SheepWorrier is offline Junior Member White Belt
    Join Date
    Oct 2004
    Posts
    7
    Ha! Just solved it myself. You need a statement like:

    objApp.PaneState = geoPaneTerritory

    (where objApp is a MapPoint.Application)

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Territory creation - glad you found a way

    Did you try running the territory creation before the data input portion of your macro? I'm getting ready to do a project with mappoint and excel and seem to be constantly frustrated about a lack of clear documentation regarding how the mappoint object model components work...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Can I embed MapPoint ActiveX Ctrl in HTML with JScript/VBScr
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-16-2006, 04:01 AM
  2. MapPoint to Gif Programatically
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 03-17-2004, 09:32 AM
  3. Replies: 1
    Last Post: 05-29-2003, 07:51 PM
  4. Key press Event of Mappoint Ctrl in VC++
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-28-2003, 11:45 AM
  5. Is MapPoint capable of programatically returning a....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-18-2002, 05:27 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 85 86 87 88 89 90 91 92 93 94 95 96