⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vba03-3.txt

📁 ao的一些代码集合
💻 TXT
字号:
Sub MyMacro()
    Dim pMxDocument As IMxDocument    '地图文档
    Dim pMap As IMap    '地图
    Dim lCount As Long
    Dim lIndex As Long
    Set pMxDocument = Application.Document    '获取当前应用程序的文档
    Set pMap = pMxDocument.FocusMap    '获取当前地图
    lCount = 0
    For lIndex = 0 To (pMap.LayerCount - 1)
        If TypeOf pMap.Layer(lIndex) Is IFeatureLayer Then    '如果当前地图的第lIndex层的类型是IFeatureLayer
            lCount = lCount + 1    '计数器加1
        End If
    Next lIndex
    MsgBox "Number of the feature layers " & _
    "in the active map: " & lCount    '显示当前地图的要素层的总数
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -