File Commands


This sample provides a set of sample commands and tools related to Output and adding data that can either be used in conjunction with the MapControl and PageLayoutControl, or can be used to customize ArcMap.

The sample assumes previous experience in creating custom Tools and Commands.

AddData command
An IGxDialog is used to browse and pick feature datasets and classes. The data is sorted based on the IFeatureClass::ShapeType property, and added to the FocusMap using the IMap::AddLayer method.
Export command
Send the ActiveView to the specified IExporter object using the IActiveView::Output method.
Print command
Send the ActiveView to the systems default printer using the IActiveView::Output method.

How to use:
  1. Register the File.dll
  2. Either add the Commands to the ArcMap interface with the Customize dialog.
  3. Or to use the Commands with the MapControl or PageLayoutControl add a reference to the 'ESRI Sample File Commands' and use the following code.
    Dim pCommand As ICommand
    Set pCommand = New ESRI_File.AddData
    pCommand.OnCreate MapControl1.Object

ArcMap, MapControl, PageLayoutControl

Minimum ArcGIS Version Required: 8.2

Difficulty: Advanced

Visual Basic
File Description
File.dll Application extentsion.
clsHook.cls VB Class Module to determine the application.
File.res Resource file containing custom bitmaps and cursors.
clsAddData.cls VB Class Module for the AddData sample command.
clsExport.cls VB Class Module for the Export sample command.
clsPrint.cls VB Class Module for the Print sample command.
frmPrintExport.frm VB Form File.
ErrorHandling.bas VB Module for error handling.
File.vbp VB Project file.