OpenMap method (MappointControl)
Closes the current map file and then opens an existing map file.
Applies to
Objects: MappointControl
Syntax
object.OpenMap(Filename)
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a MappointControl object. |
Filename | Required String. Name of the map file to open. If the map file was saved to a location other than the MapPoint default file location, the path should also be included. |
Remarks
Do not call the OpenMap method within a Microsoft Visual Basic For Each...Next statement on any MapPoint collection; it will invalidate the statement.
Example
[Visual Basic 6.0]
'Assume the MappointControl on your form is named "MappointControl1"
Private Sub Form_Load()
'Assume the file exists in the default directory
MappointControl1.OpenMap "Clients.ptm"
End Sub
[C#]
//Assume the MappointControl on your form is named "MappointControl1"
private void Form1_Load(object sender, System.EventArgs e)
{
try
{
//Assume the file exists in the default directory
MappointControl1.OpenMap("Clients.ptm");
}
catch
{
//error handling
}
}