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 2009
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 2009

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Travel Insurance Compare over 450 travel insurance policies (inc. annual multi-trip, single trip & winter sports)

  ARTICLES  


Using MapPoint from Word, Access and Excel

This article contains code snippets that allows you to seamlessly drop a map graphic into your Word, Access or Excel documents anywhere you have a valid address.

Using MapPoint From Word

MapPoint can be used from within Word. This code snippet allows you to seamlessly drop a map graphic into your Word documents anywhere you have a valid address. There is no reason to open MapPoint manually, enter the address, geocode it, copy the map to the clipboard, and then paste it into Word. This snippet does all that for you with a single mouse click.

1) Create a Macro in Normal.dot with this code:

2) Add the CreateMap Macro to your toolbar by right clicking on any toolbar and selecting customize.

3) Type a fully qualified address and click the macro.

"6531 Chesterbrook Drive, Sacramento, CA" works fine
		"6531 Chesterbrook Drive" does not work
"300 Indiana Avenue NW, Washington, DC" works great
"300 Indiana Avenue NW" does not because there are two. (MI and DC)

4) When you click the macro button on the toolbar, Word will contact MapPoint. MapPoint will then proceed to find the point and copy the map directly into your Word document.

Using MapPoint from Access forms

(MapDemo.mdb)

Microsoft Access can display MapPoint maps just like Word can. The macro is very similar to that of Word. Here, we have a form that can capture address information into a table. We can use that address information to generate a map as well as driving directions. (NOTE: For this demonstration, you can either create a database from scratch or use the accompanying MapDemo.mdb)

1) Create a form with Address information:
a. Fields for First Address: (Address, City, State)
b. Fields for Second Address: (Address2, City2, State2)
c. Field for Address Name: myName
d. Empty OLE Image (imgClip)
e. Command Button (cmdMap)

2) Add this code:

Using MapPoint from Excel

(MapDemo.xls)

We will use the same manner in which Microsoft Access accessed MapPoint and created a map in Excel. Excel will store the picture of the map right on our spreadsheet. In this example, we create a command button to launch MapPoint in the background and paste a copy of the map to the spreadsheet.

1) Add a command button to your spreadsheet.
2) Copy and paste the following code to your new command button's click event:

3) Save the spreadsheet!
4) On the B column, enter the address.
5) On the C column, enter the city
6) On the D column, enter the state
7) On the E column, enter the zip
8) Press the Command Button

Discuss this story in the forum.

Author: Christopher Gebhardt
Email: Chris(AT)CrimeAnalysis.net
URL: http://www.crimeanalysis.net
Chris Gebhardt is the Director of Marketing for CRISNet (www.crisnet.com) in Salt Lake City, Utah. He is also the CEO of Crime Analysis Associates (www.CrimeAnalysis.net) where he uses Microsoft products and specifically MapPoint in the creation of his Crime Analysis software.

Chris is a former Lieutenant with the Metropolitan Police Department in Washington, D.C. where he was the Commander of the Tactical Crime Analysis Unit responsible for crime analysis and crime mapping. This job is the basis for the TV show "The District."

In his spare time, Chris is the Technical Advisor to the California Crime and Intelligence Analysts Association (www.CrimeAnalyst.org).

Chris can be reached at chris@crimeanalysis.net.



Google
 
MP2Kmag Internet


 Recent Discussion
-BingMapsDev: From today you can now gaze up and explore the stars from Bing Maps Silverlight thx to WWT http://is.gd/aMtvs
-BingMapsDev: @jont87 I was thinking that as I virtually looked up at the stars from the Vegas strip, with all this neon I'm not sure what you'd see.
-bingmaps: BingMapApps pull local blogs, tweets, embedded videos, historic photos, worldwide telescope imagery and more into maps! http://bit.ly/bCPnlb
-bingmaps: @AllTheWiser Nice!You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @Buitel Nice!You won the BingMaps contest!DM your address and we'll mail your t-shirt.Few hours left for everyone else http://bit.ly/adOWAO
-bingmaps: @cdlongo Nice!You won the BingMaps contest!DM your address and we'll mail your t-shirt.A few hours left for other folks http://bit.ly/adOWAO
-bingmaps: @ddavidch Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @Gilly2468 Nice!You won the BingMaps contest!DM your address and we'll mail your shirt. Few hours left for other folks http://bit.ly/adOWAO
-bingmaps: @markmcc19 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @mp2kmag Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @NicolasBoonaert Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. A few more hours left for everyone else
-bingmaps: @virus84 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. A few more hours left for other folks
-bingmaps: @WebJives2 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: RT @ChrisPendleton: Watching "Opening up opportunity with Twitter" @rsarver @raffi #Mix10
-bingmaps: RT @ChrisPendleton: Windows Phone 7 Series Developer Training Kit: http://bit.ly/aHiBPW. Now, we just need to add some Bing Maps!
-bingmaps: RT @ChrisPendleton: New Bing Maps Application - WorldWide Telescope: http://bit.ly/bEwrEE.
-Importing Data into Mappoint
-deleting the number associated with pushpins.
-New Bing Maps Application: WorldWide Telescope
-bingmaps: Don't miss out! One more day to tweet to win a Bing t-shirt. Details here: http://bit.ly/adOWAO
-bingmaps: RT @ChrisPendleton: SxSW Musings and Where the World Is: http://bit.ly/9OBAU6. @BingMaps #SxSWi
-Problems with FindResults
-Restrict routes based on country of origin/destination
-How to Retrive location name form latitude and Longitude in J2ME?
-SxSW Musings and Where the World Is
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia MO Homes for Sale


Want Your Site To Appear Here?

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

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner Cartridges at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards • The Search Starts Here Used Cars
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars UK, Car Lease and Contract Hire