?? vba16-7.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 + -