SaveAs method
Saves the specified map or template. Not available for embedded maps or the MapPoint Control.
Applies to
Objects: Map
Syntax
object.SaveAs([FileName], [SaveFormat], [AddToRecentFiles])
Parameters
Part | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object | Required. An expression that returns a Map object. | ||||||||||||||||||
FileName | Optional String. Name of the file to save. You can specify the full path. If not specified, the default file name is used. | ||||||||||||||||||
SaveFormat | Optional GeoSaveFormat. Format of the file to save. Default is geoFormatMap.
|
||||||||||||||||||
AddToRecentFiles | Optional Boolean. Adds the file to the Most Recently Used (MRU) list on the File menu. Default is True. |
Remarks
If a file of the same name and format already exists, that file is overwritten. To avoid overwriting a file, check for the existence of a file before saving.
The SaveAs method invalidates any existing Recordset objects.
For finer control in creating Web pages, use the Add method and then the Save method on the SavedWebPages collection.
For the MapPoint Control, use the SaveMapAs method on a MappointControl object.
Example
Sub SaveTemplate()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objRoute As MapPoint.Route
Dim objLoc As MapPoint.Location
'Set up the application
Set objMap = objApp.ActiveMap
Set objRoute = objMap.ActiveRoute
objApp.Visible = True
objApp.UserControl = True
'Create a route
objRoute.Waypoints.Add objMap.FindResults("Seattle, WA").Item(1)
objRoute.Waypoints.Add objMap.FindResults("Redmond, WA").Item(1)
objRoute.Calculate
'Save the map as a template
objMap.SaveAs "Saved Template", geoFormatTemplate, True
End Sub
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.