123456789101112131415161718192021222324252627282930313233343536 |
- Attribute VB_Name = "裁切编号"
- Sub ShapesRange()
-
- Application.Optimization = True
-
- Dim d As Document
- Dim number As Shape
- Dim cnt As Integer
- cnt = 1
- Set d = ActiveDocument
-
- With ActiveLayer.Shapes
- MsgBox "总共有物件个数 " & .Count
- End With
-
- Dim s1 As Shape
- For Each Target In ActiveLayer.Shapes
- Set s1 = Target
-
-
- cx = s1.CenterX
- cy = s1.CenterY
- sw = s1.SizeWidth
- sh = s1.SizeHeight
-
- Text = Trim(Str(cnt))
- Set number = d.ActiveLayer.CreateArtisticText(cx, cy, Text)
- cnt = cnt + 1
- Next Target
-
-
- Application.Optimization = False
- ActiveWindow.Refresh
- Application.Refresh
- End Sub
|