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

📄 vba16-7.txt

📁 AO的原代码,都是以TXT的文件写的,对你肯定有帮助的.这些都是 我的心血啊.
💻 TXT
字号:
Public Function GetMapFrameByName(strMapName) As IElement
    ' Return the map frame that
    ' holds a map (dataset) with
    ' the given name.
    Dim pMxDocument As IMxDocument
    Dim pPageLayout As IPageLayout
    Dim pGraphicsContainer As IGraphicsContainer
    Dim pElementsSet As ISet
    Dim pElement As IElement
    Dim pActiveView As IActiveView
    Dim pMapFrame As IMapFrame
    ' Access the page layout.
    Set GetMapFrameByName = Nothing
    Set pMxDocument = Application.Document
    Set pPageLayout = pMxDocument.PageLayout
    Set pGraphicsContainer = pPageLayout
    ' Loop through graphics elements
    ' and examine each one.
    pGraphicsContainer.Reset
    Set pElement = pGraphicsContainer.Next
    Do While Not pElement Is Nothing
        If TypeOf pElement Is IMapFrame Then
            Set pMapFrame = pElement
            If UCase(pMapFrame.Map.Name) = strMapName Then
                Set GetMapFrameByName = pElement
                Exit Do
            End If
        End If
        Set pElement = pGraphicsContainer.Next
    Loop
End Function

⌨️ 快捷键说明

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