MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




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

This is a discussion on Ctrl+T (Data -> Territories...) programatically MapPoint within the MapPoint 2006/2009 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 ...


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

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 04-06-2005
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.
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 04-06-2005
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)
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 04-06-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
hi,

thanx for feedback
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 04-12-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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...
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
>, ctrl, data, mappoint, programatically, territories


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
Can I embed MapPoint ActiveX Ctrl in HTML with JScript/VBScr Anonymous MapPoint 2006/2009 Discussion 2 01-16-2006 04:01 AM
MapPoint to Gif Programatically Anonymous MapPoint 2006/2009 Discussion 5 03-17-2004 09:32 AM
.Save and .SaveAs don't work in from VB using MapPoint Ctrl Anthony_Hunt Wish List 1 05-29-2003 07:51 PM
Key press Event of Mappoint Ctrl in VC++ Anonymous MapPoint 2006/2009 Discussion 1 04-28-2003 11:45 AM
Is MapPoint capable of programatically returning a.... Anonymous MapPoint 2006/2009 Discussion 1 07-18-2002 05:27 AM


All times are GMT -5. The time now is 07:35 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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