Map Merge Sample Application

 

Microsoft Corporation

July 2004

Applies to:
   Microsoft MapPoint 2002
   Microsoft MapPoint 2004

Summary: Learn about the Map Merge sample application for Microsoft MapPoint. (2 printed pages)

Click here to download the code sample for this article.

Contents

Introduction
Running the Map Merge Application

Introduction

The Map Merge sample application is a Microsoft Word macro, written in Microsoft Visual Basic for Applications, that demonstrates how you can easily embed customized MapPoint maps in a form letter. The application uses Microsoft MapPoint as an Object Linking and Embedding (OLE) data source to generate the maps that are embedded within a Word document.

The application demonstrates a practical business use of Office applications by taking two sets of data (a Microsoft Excel spreadsheet containing potential customer information and another containing business information), analyzing them and matching potential customers with the closest business location, and merging this data into a form letter that provides the potential customer with a map and driving directions to the nearest store location.

Running the Map Merge Application

The download contains a Word document, MapMerge.doc, which is used as the template document in a Word Mail Merge operation. The document is a sample form letter with merge fields and insertion points for customer information, store information, and MapPoint maps. The document is linked to the Excel file Customers.xls, which contains the source data for the Mail Merge operation.

To run the Map Merge application

  1. Open MapMerge.doc in Word.
  2. On the Tools menu, point to Macro, and then click Macros.
  3. In the Macros list, click DisplayMapMergeForm.
  4. Click Run.
  5. To merge all the records in the data set, select All; to merge a specific range of records, select From and type the range of records you want to merge.
  6. Click Merge.

To view the code for the application

  1. Open MapMerge.doc in Microsoft Word.
  2. On the Tools menu, point to Macro, and then click Macros.
  3. In the Macros list, click DisplayMapMergeForm.
  4. Click Step Into.