' Eric Frost, www.MP2Kmag.com Private Sub Create_Iraq_Grid_Map() Dim objApp As New MapPoint.Application Dim objMap As MapPoint.Map Dim objLoc(1 To 5) As MapPoint.Location Dim x, y As Double Dim i, j, item As Integer 'Set up the application Set objMap = objApp.ActiveMap objApp.Visible = True objApp.UserControl = True objApp.ActiveMap.MapStyle = geoMapStylePolitical 'Starting values x = 38.90587 y = 29.05803 item = 1 For j = 1 To 24 For i = 1 To 25 'Get three locations and zoom in Set objLoc(1) = objApp.ActiveMap.GetLocation(y, x) Set objLoc(2) = objApp.ActiveMap.GetLocation(y + 0.34698916666666, x) Set objLoc(3) = objApp.ActiveMap.GetLocation(y + 0.34698916666666, x + 0.42056739130437) Set objLoc(4) = objApp.ActiveMap.GetLocation(y, x + 0.42056739130437) Set objLoc(5) = objApp.ActiveMap.GetLocation(y, x) Set objMap.Location = objLoc(1) 'Create a polyline by connecting these locations objMap.Shapes.AddPolyline objLoc objMap.Shapes.item(item).Line.Weight = 0.1 'objMap.Shapes.item(item).Fill.Visible = True 'objMap.Shapes.item(item).Fill.ForeColor = vbRed objMap.Shapes.item(item).ZOrder geoSendBehindRoads y = y + 0.34698916666666 item = item + 1 Next x = x + 0.42056739130437 y = 29.05803 Next End Sub