identify button through VBA form

Discussion created by priyanka_mehta on Mar 9, 2011
Latest reply on Mar 13, 2011 by priyanka_mehta
Hi all,

  I am facing a rather simple problem i believe but unfortunately not being able to find a solution.

I need to extract x,y from a map on mouse down event just like the identify button works but i need to do it through a button in VBA form. I cannot use UIToolcontrol !

The below code does what i want by button click and this is easily done by UITool but I need it on a vba form

Dim pPoint As IPoint
Dim pApp As IMxApplication

Set pApp = Application

' Convert mouse click to map units
Set pPoint = pApp.Display.DisplayTransformation.ToMapPoint(X, Y)

MsgBox "Coordinates: " & pPoint.X & ", " & pPoint.Y

Please help.