из хелпа
To select a layer in the table of contents, obtain an
IContentsView reference via
IMxDocument::ContentsView, then use either
IContentsView::AddToSelectedItems or
IContentsView::SelectedItem. To learn more, read the help for
IContentsView.
Sub SelectLayersInDisplayView()
' selects all of the layers in the first data frame in the TOC's display view
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pTOC As IContentsView
Set pTOC = pMxDoc.ContentsView(0) ' Display View
Dim pMaps As IMaps
Set pMaps = pMxDoc.Maps
Dim pMap As IMap
Dim i As Integer
Set pMap = pMaps.Item(0) ' first data frame
Dim pEnumLayer As IEnumLayer
Set pEnumLayer = pMap.Layers(, False) ' we will not select layers within group layers
Dim pLayer As ILayer
Set pLayer = pEnumLayer.Next
pTOC.RemoveFromSelectedItems pTOC.SelectedItem
Do While Not pLayer Is Nothing
pTOC.AddToSelectedItems pLayer
pTOC.Refresh pLayer
Set pLayer = pEnumLayer.Next
Loop
End Sub