Accessing a tool from a form

Discussion created by stanles on Oct 5, 2011
Latest reply on Oct 10, 2011 by stanles

I am upgrading a VB6 extension into VB.NET and am having a problem with part of the process.  For information I am using Visual Studio 2008 to create the VB.NET extension.

I had a tool on a form which I created to interact with the ArcMap session  and call another script in the extension.  Below are the bits of the VB6 script which are probably the most relevant.

If any additional code is needed, etcetera, let me know.


Under the general declarations there was:

Dim m_pAppRef As New AppRef

And then the actual click event for the tool was:

Private Sub cmdSelect1_Click()

    Dim pUID As New UID
    Dim pCommandItem As ICommandItem
    pUID.Value = "DOALOSextension.SelectPoint"
    Set pCommandItem = m_pAppRef.Document.CommandBars.Find(pUID, False, False)
End Sub