複製圖形範圍,並傳回複本參照。
語法
運算式。[同步顯示]
運算式 代表 'ShapeRange' 物件的變數。
傳回值
ShapeRange
註解
複製的圖形範圍的水平偏移和垂直偏移距離原始圖形範圍都是 12 點。
範例
下列範例會使用 ShapeRange.Apply 方法中的程式碼範例所建立的報表。 此範例會複製包含兩個圖形的圖形範圍,然後垂直翻轉並選取新的圖形範圍。
Sub DuplicateShapeRange()
Dim theReport As Report
Dim shp1 As shape
Dim shp2 As shape
Dim shp3 As shape
Dim reportName As String
Dim sRange1 As ShapeRange
Dim sRange2 As ShapeRange
reportName = "Apply Report"
Set theReport = ActiveProject.Reports(reportName)
Set shp1 = theReport.Shapes(1)
Set shp2 = theReport.Shapes(2)
Set shp3 = theReport.Shapes(3)
Set sRange1 = theReport.Shapes.Range(Array(2, 3))
Set sRange2 = sRange1.Duplicate()
sRange2.Flip msoFlipVertical
sRange2.Select
End Sub
另請參閱
ShapeRange 物件Shape.Duplicate 方法
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。