📄 vba14-1.txt
字号:
Private Function FindLayer(strBrowseName As String) _
As ILayer
' Find the matching layer in the focus map.
' Return NOTHING if not found.
Dim lngIndex As Long
Dim pMxDocument As IMxDocument
Dim pMap As IMap
Dim pDataset As IDataset
Set FindLayer = Nothing
Set pMxDocument = Application.Document
Set pMap = pMxDocument.FocusMap
' Loop through layers and search
' for the matching name.
For lngIndex = 0 To (pMap.LayerCount - 1)
If TypeOf pMap.Layer(lngIndex) Is FeatureLayer Then
Set pDataset = pMap.Layer(lngIndex)
If pDataset.BrowseName = strBrowseName Then
Set FindLayer = pMap.Layer(lngIndex)
Exit For
End If
End If
Next lngIndex
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -