I'll use my Attribution Assistant in the following example - Download the installation package (12 kb)
What's included:
- _Attribution_Icon.bmp is a graphic to use as the icon that will be used to launch the tool from the ArcMap interface
- frmAttribution v2.0.frm is the form that will be imported into ArcMap. The source code is stored in this file, and can be viewed when opened by a text editor. Do not change any of these settings via text editor.
- frmAttribution v2.0.frx a VB binary file that accompanies the .frm file that holds graphics and other information that will be used by the application
- Installation instructions.txt is a "Readme" text file with information about the plugin
Install:
- Open ArcMap
- Open the Visual Basic Editor from Tools menu under Tools :: Macros :: Visual Basic Editor
- Locate the Project Explorer (see below). If you want the tool to be available every time you open ArcMap, you'll import the plugin under the Normal.mxt branch. Otherwise, installing the application under the Project branch in the Project Explorer will only allow access to the tool when working under a specific ArcMap project (a saved .mxd file).
Undocked Visual Basic Project Explorer
- Right click on the Normal branch and choose Import File so the plugin will be available every time ArcMap is opened. Navigate to where the install package was unzipped, choose frmAttribution v2.0.frm and click Open. Expand Normal and Forms to view the new form (see below), otherwise close the Visual Basic Editor.
frmAttribution successfully imported
- Back in ArcMap open the Customize dialog via Tools :: Customize
- Navigate to the Commands tab
- Ensure that the Save in: setting is set to Normal.mxt to ensure that the tool will be available every time ArcMap is opened
- Scroll to the bottom of the Categories menu and select [ UI Controls ]
- Click the New UIControl button, choose UIButton Control
- Slow double click on the new control probably named Normal.UIButtonControl1 in the Commands list and rename it "Attribution_Launch." When you press enter it will automatically rename itself "Normal.Attribution_Launch"
- Drag the new control onto the ArcMap interface
- Change the button face icon: With the Customize dialog still opened, right click on the icon that was just dropped onto the ArcMap interface and under the Change Button Image sub-menu, choose Browse
- Navigate to the directory where the installation package was unzipped, choose _Attribution_Icon.bmp and click Open
- With the Customize dialog still open, right click on the new button on the ArcMap interface one more time and choose View Source. The Visual Basic Editor will open, and will automatically open the ThisDocument code under Normal.mxt, with some code written for you (don't worry if you don't completely understand this part, just follow the directions to get through it)
- Copy and following line and paste it into the Attribution_Launch_Click subroutine:
Normal.frmAttribution.Show (vbModeless)
It should look like the following:
Private Sub Attribution_Launch_Click()
Normal.frmAttribution.Show (vbModeless)
End Sub
- Close the Visual Basic Editor when finished and you're good to go! Click on your new button to launch the newly imported ArcMap plugin!