?? vba16-8.txt
字號:
Private Sub AddRectangle(pEnvelope As IEnvelope)
' Draw a rectangle using the
' given envelope.
Dim pMxDocument As IMxDocument
Dim pPageLayout As IPageLayout
Dim pActiveView As IActiveView
Dim pGraphicsContainer As IGraphicsContainer
Dim pRectangleElement As IElement
Dim pFillShapeElement As IFillShapeElement
Dim pFillRGBColor As IRgbColor
Dim pLineRGBColor As IRgbColor
Dim pFillSymbol As IFillSymbol
Dim pLineSymbol As ILineSymbol
' Access the page layout.
Set pMxDocument = Application.Document
Set pPageLayout = pMxDocument.PageLayout
Set pActiveView = pPageLayout
Set pGraphicsContainer = pPageLayout
' Set the fill color to be
' transparent.
Set pFillRGBColor = New RgbColor
pFillRGBColor.Transparency = 0
Set pFillSymbol = New SimpleFillSymbol
pFillSymbol.Color = pFillRGBColor
' Set the outline color to black.
Set pLineRGBColor = New RgbColor
pLineRGBColor.Red = 0
pLineRGBColor.Green = 0
pLineRGBColor.Blue = 0
Set pLineSymbol = New SimpleLineSymbol
pLineSymbol.Color = pLineRGBColor
pLineSymbol.Width = 1#
pFillSymbol.Outline = pLineSymbol
' Create the rectangle element.
Set pRectangleElement = New RectangleElement
Set pFillShapeElement = pRectangleElement
pFillShapeElement.Symbol = pFillSymbol
' Position the rectangle and
' display it on the page layout.
pRectangleElement.Geometry = pEnvelope
pRectangleElement.Activate pActiveView.ScreenDisplay
pGraphicsContainer.AddElement pRectangleElement, 0
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -