| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 | Attribute VB_Name = "API"Public Function GetSet(s As String)  Bleed = Val(GetSetting("262235.xyz", "Settings", "Bleed", "2.0"))  Line_len = Val(GetSetting("262235.xyz", "Settings", "Line_len", "3.0"))  Outline_Width = Val(GetSetting("262235.xyz", "Settings", "Outline_Width", "0.2"))' Debug.Print Bleed, Line_len, Outline_Width  If s = "Bleed" Then    GetSet = Bleed  ElseIf s = "Line_len" Then    GetSet = Line_len  ElseIf s = "Outline_Width" Then    GetSet = Outline_Width  End If  End Function'// 获得剪贴板文本字符Public Function GetClipBoardString() As String  On Error Resume Next  Dim MyData As New DataObject  GetClipBoardString = ""  MyData.GetFromClipboard  GetClipBoardString = MyData.GetText  Set MyData = NothingEnd Function'// 文本字符复制到剪贴板Public Function WriteClipBoard(s As String)  On Error Resume Next  Dim MyData As New DataObject  MyData.SetText s  MyData.PutInClipboardEnd Function'// 获得数组元素个数Public Function arrlen(src As Variant) As Integer  On Error Resume Next '空意味着 0 长度  arrlen = (UBound(src) - LBound(src))End Function'// 对数组进行排序[单维]Public Function ArraySort(src As Variant) As Variant  Dim out As Long, i As Long, tmp As Variant  For out = LBound(src) To UBound(src) - 1    For i = out + 1 To UBound(src)      If src(out) > src(i) Then        tmp = src(i): src(i) = src(out): src(out) = tmp      End If    Next i  Next out    ArraySort = srcEnd Function'// 测试数组排序Private test_ArraySort()  Dim arr As Variant, i As Integer  arr = Array(5, 4, 3, 2, 1, 9, 999, 33)  For i = 0 To arrlen(arr) - 1    Debug.Print arr(i);  Next i  Debug.Print arrlen(arr)  ArraySort arr  For i = 0 To arrlen(arr) - 1    Debug.Print arr(i);  Next iEnd SubFunction FindAllShapes() As ShapeRange    Dim s As Shape    Dim srPowerClipped As New ShapeRange    Dim sr As ShapeRange, srAll As New ShapeRange        If ActiveSelection.Shapes.Count > 0 Then        Set sr = ActiveSelection.Shapes.FindShapes()    Else        Set sr = ActivePage.Shapes.FindShapes()    End If        Do        For Each s In sr.Shapes.FindShapes(Query:="[email protected]")            srPowerClipped.AddRange s.PowerClip.Shapes.FindShapes()        Next s        srAll.AddRange sr        sr.RemoveAll        sr.AddRange srPowerClipped        srPowerClipped.RemoveAll    Loop Until sr.Count = 0        Set FindAllShapes = srAllEnd Function
 |