Share via


ShowLinkTerritoriesWizard method

Opens the Link Territories Wizard; similar to clicking Territories on the Data menu, selecting Create from your own set of data, and then selecting Link to your source file. Returns a DataSet object for a territories set, if one is created. Returns nothing if the user cancels out of the wizard.

Applies to

Collections: DataSets

Syntax

object.ShowLinkTerritoriesWizard([HWndParent], [DataSourceMoniker], [Delimeter], [ImportFlags])

Parameters

Part

Description

object

Required. An expression that returns a DataSets collection.

HWndParent

Optional Long. Handle of the user's window, to allow the Link Territories Wizard to be modal to a window in the calling application, rather than MapPoint.

Note   Do not use a handle for a window other than the MapPoint window if the MapPoint window is visible.

DataSourceMoniker

Optional String. File name to link. Can also provide information on which part of the file to link. See the DataSourceMoniker syntax topic for the correct syntax to use for this parameter. If a file name is not specified, the user interface will prompt the user for a file to link.

Delimiter

Optional GeoDelimiter. Characters that separate individual fields. Can be one or more characters. Required for linking text (.txt) files. Default is geoDelimiterDefault.

GeoDelimiterValueDescription
geoDelimiterComma44Fields separated by commas (","). Default for .csv files.
geoDelimiterDefault0
MapPoint determines the delimiter based on the file type.
File typeDefault Delimiter
.asctab
.csvcomma
.tabtab
.txttab
geoDelimiterSemicolon59Fields separated by semicolons.
geoDelimiterTab9Fields separated by tabs ("\t"). Default for .tab, .txt, and .asc files.

ImportFlags

Optional Long. Provides information about the DataSourceMoniker and the data in the file. Multiple values can be passed by using the Visual Basic "Or" operator (for example, geoImportExcelNamedRange Or geoImportFirstRowIsNotHeadings).

GeoImportFlagsValueDescription
geoImportAccessQuery4DataSourceMoniker specifies an Access query.
geoImportAccessTable0DataSourceMoniker specifies an Access table. Default.
geoImportExcelA10DataSourceMoniker specifies Excel A1 syntax. Default.
geoImportExcelNamedRange4DataSourceMoniker specifies an Excel named range.
geoImportExcelR1C12DataSourceMoniker specifies Excel R1C1 syntax.
geoImportExcelSheet0DataSourceMoniker specifies an Excel worksheet. Default.
geoImportFirstRowIsHeadings0First row of the file contains field names. Default.
geoImportFirstRowNotHeadings1First row of the file does not contain field names.

Remarks

  • To link data that defines a set of territories as a DataSet object, use the LinkTerritories method on a DataSets collection.

Example

Sub ShowWizard()
Dim objApp As New MapPoint.Application
objApp.Visible = True
objApp.UserControl = True
Dim objDS As MapPoint.DataSet

With objApp.ActiveMap.DataSets
'Show the Link Territories Wizard centered on the form
Set objDS = .ShowLinkTerritoriesWizard
End With
End sub

Example using parameters

Sub ShowWizard()
Dim objApp As New MapPoint.Application
objApp.Visible = True
objApp.UserControl = True
Dim strFile As String
Dim objDS As MapPoint.DataSet

With objApp.ActiveMap.DataSets
'Excel sheet
strFile = objApp.Path & "\Samples\Terrs.xls!Sheet1!A1:E127"
Set objDS = .ShowLinkTerritoriesWizard(, strFile, , geoImportExcelSheet)
End With
End sub