CorelVBA.bas 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. VERSION 5.00
  2. Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} CorelVBA
  3. Caption = "CorelVBA 青年节 By 蘭雅sRGB 2022"
  4. ClientHeight = 5415
  5. ClientLeft = 45
  6. ClientTop = 330
  7. ClientWidth = 7740
  8. OleObjectBlob = "CorelVBA.frx":0000
  9. StartUpPosition = 1 '所有者中心
  10. End
  11. Attribute VB_Name = "CorelVBA"
  12. Attribute VB_GlobalNameSpace = False
  13. Attribute VB_Creatable = False
  14. Attribute VB_PredeclaredId = True
  15. Attribute VB_Exposed = False
  16. #If VBA7 Then
  17. Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  18. Private Declare PtrSafe Function DrawMenuBar Lib "user32" (ByVal Hwnd As Long) As Long
  19. Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long
  20. Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  21. Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  22. Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  23. #Else
  24. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  25. Private Declare Function DrawMenuBar Lib "user32" (ByVal Hwnd As Long) As Long
  26. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long) As Long
  27. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal Hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  28. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  29. Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
  30. #End If
  31. Private Const GWL_STYLE As Long = (-16)
  32. Private Const GWL_EXSTYLE = (-20)
  33. Private Const WS_CAPTION As Long = &HC00000
  34. Private Const WS_EX_DLGMODALFRAME = &H1&
  35. Private switch As Boolean
  36. Private Sub Close_Icon_Click()
  37. Unload Me ' 关闭
  38. End Sub
  39. Private Sub ToolBar_show_Click()
  40. Unload Me
  41. ToolBar.Show 0
  42. End Sub
  43. Private Sub UserForm_Initialize()
  44. Dim IStyle As Long
  45. Dim Hwnd As Long
  46. Hwnd = FindWindow("ThunderDFrame", Me.Caption)
  47. IStyle = GetWindowLong(Hwnd, GWL_STYLE)
  48. IStyle = IStyle And Not WS_CAPTION
  49. SetWindowLong Hwnd, GWL_STYLE, IStyle
  50. DrawMenuBar Hwnd
  51. IStyle = GetWindowLong(Hwnd, GWL_EXSTYLE) And Not WS_EX_DLGMODALFRAME
  52. SetWindowLong Hwnd, GWL_EXSTYLE, IStyle
  53. With Me
  54. ' .StartUpPosition = 0
  55. ' .Left = 500
  56. ' .Top = 200
  57. .Width = 385.5
  58. .Height = 271.45
  59. End With
  60. End Sub
  61. Private Sub LOGO_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  62. If Button Then
  63. mx = x
  64. my = y
  65. End If
  66. End Sub
  67. Private Sub LOGO_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  68. If Button Then
  69. Me.Left = Me.Left - mx + x
  70. Me.Top = Me.Top - my + y
  71. End If
  72. End Sub
  73. Private Sub CommandButton1_Click()
  74. MsgBox "请给我支持!" & vbNewLine & "您的支持,我才能有动力添加更多功能." & vbNewLine & "蘭雅CorelVBA青年节版公测" & vbNewLine & "coreldrawvba插件交流群 8531411"
  75. End Sub
  76. Private Sub UI_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
  77. ' 定义图标坐标pos
  78. Dim pos_x As Variant
  79. Dim pos_y As Variant
  80. pos_x = Array(32, 110, 186, 265, 345)
  81. pos_y = Array(50, 135, 215)
  82. If Abs(x - pos_x(0)) < 30 And Abs(y - pos_y(0)) < 30 Then
  83. 物件角线
  84. ElseIf Abs(x - pos_x(1)) < 30 And Abs(y - pos_y(0)) < 30 Then
  85. 绘制矩形
  86. ElseIf Abs(x - pos_x(2)) < 30 And Abs(y - pos_y(0)) < 30 Then
  87. 角线爬虫
  88. ElseIf Abs(x - pos_x(3)) < 30 And Abs(y - pos_y(0)) < 30 Then
  89. 矩形拼版
  90. ElseIf Abs(x - pos_x(4)) < 30 And Abs(y - pos_y(0)) < 30 Then
  91. 拼版角线
  92. End If
  93. If Abs(x - pos_x(0)) < 30 And Abs(y - pos_y(1)) < 30 Then
  94. Tools.居中页面
  95. ElseIf Abs(x - pos_x(1)) < 30 And Abs(y - pos_y(1)) < 30 Then
  96. 拼版标记
  97. ElseIf Abs(x - pos_x(2)) < 30 And Abs(y - pos_y(1)) < 30 Then
  98. 智能群组
  99. ElseIf Abs(x - pos_x(3)) < 30 And Abs(y - pos_y(1)) < 30 Then
  100. CQL选择
  101. ElseIf Abs(x - pos_x(4)) < 30 And Abs(y - pos_y(1)) < 30 Then
  102. 批量替换
  103. End If
  104. If Abs(x - pos_x(0)) < 30 And Abs(y - pos_y(2)) < 30 Then
  105. Tools.尺寸取整
  106. ElseIf Abs(x - pos_x(1)) < 30 And Abs(y - pos_y(2)) < 30 Then
  107. Tools.TextShape_ConvertToCurves
  108. ElseIf Abs(x - pos_x(2)) < 30 And Abs(y - pos_y(2)) < 30 Then
  109. Dim h As Long, r As Long
  110. mypath = Path & "GMS\262235.xyz\"
  111. app = mypath & "GuiAdobeThumbnail.exe"
  112. h = FindWindow(vbNullString, "CorelVBA 青年节 By 蘭雅sRGB")
  113. i = ShellExecute(h, "", app, "", mypath, 1)
  114. ElseIf Abs(x - pos_x(3)) < 30 And Abs(y - pos_y(2)) < 30 Then
  115. If switch Then
  116. switch = Not switch
  117. Tools.傻瓜火车排列
  118. Else
  119. switch = Not switch
  120. Tools.傻瓜阶梯排列
  121. End If
  122. ElseIf Abs(x - pos_x(4)) < 30 And Abs(y - pos_y(2)) < 30 Then
  123. 学习CorelVBA实验室
  124. End If
  125. If Abs(x - 210) < 30 And Abs(y - 261) < 8 Then
  126. WebHelp "https://262235.xyz/index.php/tag/vba/"
  127. End If
  128. End Sub
  129. Function WebHelp(url As String)
  130. Dim h As Long, r As Long
  131. h = FindWindow(vbNullString, "CorelVBA 青年节 By 蘭雅sRGB")
  132. r = ShellExecute(h, "", url, "", "", 1)
  133. End Function
  134. Private Sub 绘制矩形()
  135. 剪贴板尺寸建立矩形.start
  136. End Sub
  137. Private Sub 角线爬虫()
  138. 裁切线.SelectLine_to_Cropline
  139. End Sub
  140. Private Sub 矩形拼版()
  141. 拼版裁切线.arrange
  142. End Sub
  143. Private Sub 批量替换()
  144. CorelVBA.Hide
  145. Replace_UI.Show 0
  146. End Sub
  147. Private Sub 拼版标记()
  148. 自动中线色阶条.Auto_ColorMark
  149. End Sub
  150. Private Sub 拼版角线()
  151. 拼版裁切线.Cut_lines
  152. End Sub
  153. Private Sub 物件角线()
  154. 裁切线.start
  155. End Sub
  156. Private Sub 智能群组()
  157. 智能群组和查找.智能群组
  158. End Sub
  159. Private Sub CQL选择()
  160. CorelVBA.Hide
  161. CQL_FIND_UI.Show 0
  162. End Sub
  163. Private Sub 学习CorelVBA实验室()
  164. CorelVBA.Hide
  165. ' 调用语句
  166. i = GMSManager.RunMacro("CorelDRAW_VBA", "学习CorelVBA.start")
  167. End Sub