123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- Attribute VB_Name = "Arrange"
- Public Function Arrange()
- On Error GoTo ErrorHandler
- API.BeginOpt
- ActiveDocument.Unit = cdrMillimeter
- row = 3
- List = 4
- sp = 0
- Dim Str, arr, n
- Str = API.GetClipBoardString
-
- Str = VBA.Replace(Str, "mm", " ")
- Str = VBA.Replace(Str, "x", " ")
- Str = VBA.Replace(Str, "X", " ")
- Str = VBA.Replace(Str, "*", " ")
-
- Str = API.Newline_to_Space(Str)
-
- arr = Split(Str)
- Dim s1 As Shape
- Dim X As Double, Y As Double
-
- If 0 = ActiveSelectionRange.Count Then
- X = Val(arr(0)): Y = Val(arr(1))
- row = Int(ActiveDocument.Pages.First.SizeWidth / X)
- List = Int(ActiveDocument.Pages.First.SizeHeight / Y)
- If UBound(arr) > 2 Then
- row = Val(arr(2)): List = Val(arr(3))
- If row * List > 8000 Then
- GoTo ErrorHandler
- ElseIf UBound(arr) > 3 Then
- sp = Val(arr(4))
- End If
- End If
-
-
- Set s1 = ActiveLayer.CreateRectangle(0, 0, X, Y)
-
-
- s1.Fill.ApplyNoFill
- s1.Outline.SetProperties 0.3, OutlineStyles(0), CreateCMYKColor(0, 100, 0, 0), ArrowHeads(0), _
- ArrowHeads(0), cdrFalse, cdrFalse, cdrOutlineButtLineCaps, cdrOutlineMiterLineJoin, 0#, 100, MiterLimit:=5#
-
- ElseIf 1 = ActiveSelectionRange.Count Then
- Set s1 = ActiveSelection
- X = s1.SizeWidth: Y = s1.SizeHeight
- row = Int(ActiveDocument.Pages.First.SizeWidth / X)
- List = Int(ActiveDocument.Pages.First.SizeHeight / Y)
- End If
-
- sw = X: sh = Y
-
- Dim dup1 As ShapeRange
- Set dup1 = s1.StepAndRepeat(row - 1, sw + sp, 0#)
- Dim dup2 As ShapeRange
- Set dup2 = ActiveDocument.CreateShapeRangeFromArray(dup1, s1).StepAndRepeat(List - 1, 0#, (sh + sp))
-
- ErrorHandler:
- API.EndOpt
- End Function
|