1
1

CQLFindSame.bas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Attribute VB_Name = "CQLFindSame"
  2. Sub 属性选择()
  3. CQL_FIND_UI.Show 0
  4. End Sub
  5. Public Function CQLline_CM100()
  6. On Error GoTo err
  7. Dim cm(5) As Color, i As Long
  8. Set cm(0) = CreateCMYKColor(100, 0, 100, 0) '绿
  9. Set cm(1) = CreateCMYKColor(0, 100, 0, 0) '洋红
  10. Set cm(2) = CreateCMYKColor(100, 100, 0, 0) '红
  11. Set cm(3) = CreateRGBColor(0, 255, 0) ' RGB 绿
  12. Set cm(4) = CreateRGBColor(255, 0, 0) ' RGB 红
  13. ActiveDocument.ClearSelection
  14. For i = 0 To 4
  15. cm(i).ConvertToRGB
  16. r = cm(i).RGBRed
  17. G = cm(i).RGBGreen
  18. b = cm(i).RGBBlue
  19. ActivePage.Shapes.FindShapes(Query:="@Outline.Color.rgb[.r='" & r & "' And .g='" & G & "' And .b='" & b & "']").AddToSelection
  20. Next i
  21. Exit Function
  22. err:
  23. MsgBox "Function CQLline_CM100 错误!"
  24. End Function
  25. Sub 一键加点工具()
  26. Dim OrigSelection As ShapeRange
  27. Set OrigSelection = ActiveSelectionRange
  28. If OrigSelection.Count <> 0 Then
  29. OrigSelection.Copy
  30. Else
  31. MsgBox "选择水洗标要加点部分,然后点击【加点工具】按钮!"
  32. Exit Sub
  33. End If
  34. ' 新建文件粘贴
  35. Dim doc1 As Document
  36. Set doc1 = CreateDocument
  37. ActiveLayer.Paste
  38. ' 转曲线,一键加粗小红点
  39. ActiveSelection.ConvertToCurves
  40. Call get_little_points
  41. End Sub
  42. Private Sub get_little_points()
  43. On Error GoTo ErrorHandler
  44. '// 代码运行时关闭窗口刷新
  45. Application.Optimization = True
  46. ActiveDocument.BeginCommandGroup '一步撤消'
  47. red_point_Size = 0.3
  48. ActiveDocument.Unit = cdrMillimeter
  49. Dim OrigSelection As ShapeRange, grp1 As ShapeRange, sh As Shape
  50. Set OrigSelection = ActiveSelectionRange
  51. Set grp1 = OrigSelection.UngroupAllEx
  52. grp1.ApplyUniformFill CreateCMYKColor(50, 0, 0, 0)
  53. For Each sh In grp1
  54. sh.BreakApartEx
  55. Next sh
  56. ActiveDocument.ClearSelection
  57. Dim sr As ShapeRange
  58. Set sr = ActivePage.Shapes.FindShapes(Query:="@width < {" & red_point_Size & " mm} and @width > {0.1 mm} and @height <{" & red_point_Size & " mm} and @height >{0.1 mm}")
  59. If sr.Count <> 0 Then
  60. sr.CreateSelection
  61. Set sh = ActiveSelection.group
  62. sh.Outline.SetProperties 0.03, Color:=CreateCMYKColor(0, 100, 100, 0)
  63. sr.ApplyUniformFill CreateCMYKColor(0, 100, 100, 0)
  64. sh.Move 0, 0.015
  65. sh.Copy
  66. Else
  67. MsgBox "文件中小圆点足够大,不需要加粗!"
  68. End If
  69. ActivePage.Shapes.FindShapes(Query:="@colors.find(CMYK(50, 0, 0, 0))").CreateSelection
  70. ActiveSelection.group
  71. ActiveDocument.EndCommandGroup
  72. Application.Optimization = False
  73. ActiveWindow.Refresh
  74. Application.Refresh
  75. Exit Sub
  76. ErrorHandler:
  77. MsgBox "选择水洗标要加点部分,然后点击【加点工具】按钮!"
  78. Application.Optimization = False
  79. On Error Resume Next
  80. End Sub
  81. Sub 文字转曲()
  82. Tools.TextShape_ConvertToCurves
  83. End Sub