This script moves the selection anchor to a polygon's label point. By default, ArcMap places the selection anchor at the center of the selected feature's envelope, which may or may not fall within the selected polygon.
How to use
- Select one polygon feature.
- Paste the code into VBA and run the macro.
Public Sub PlaceAnchorPointatLabel()
Dim pEditor As IEditor
Dim pArea As IArea
Dim pPolygon As IPolygon
Dim pID As New UID
'Get a handle to the Editor
pID = "esriEditor.Editor"
Set pEditor = Application.FindExtensionByCLSID(pID)
If Not pEditor.SelectionCount = 1 Then Exit Sub
'Get the selected feature and move the Editor's selection anchor
'To the labelpoint of the polygon
If TypeOf pEditor.EditSelection.Next.Shape Is Polygon Then
Set pPolygon = pEditor.EditSelection.Next.Shape
Set pArea = pPolygon
pEditor.SelectionAnchor.MoveTo pArea.LabelPoint, pEditor.Display
End If
End Sub