ThisMacroStorage.cls 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. VERSION 1.0 CLASS
  2. BEGIN
  3. MultiUse = -1 'True
  4. END
  5. Attribute VB_Name = "ThisMacroStorage"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = False
  8. Attribute VB_PredeclaredId = True
  9. Attribute VB_Exposed = True
  10. Private Sub GlobalMacroStorage_start()
  11. On Error GoTo ErrorHandler
  12. Dim creatTool As Boolean: creatTool = True
  13. StartButton = Val(GetSetting("LYVBA", "Settings", "StartButton", "0"))
  14. If StartButton = 1 Then creatTool = False
  15. If creatTool Then
  16. SaveSetting "LYVBA", "Settings", "StartButton", "1"
  17. AddPluginCommand "LYVBA.CorelVBA.Start", "CorelVBA.Start", "CorelVBA.Start"
  18. AddPluginCommand "LYVBA.CorelVBA.Start_Dimension", "CorelVBA.Start_Dimension", "CorelVBA.Start_Dimension"
  19. AddPluginCommand "LinesTool.lines.start", "lines.start", "lines.start"
  20. AddPluginCommand "ZeroBase.Hello_VBA.run", "Hello_VBA.run", "Hello_VBA.run"
  21. For Each Item In CommandBars
  22. If Item.name = "CorelVBA" Then
  23. creatTool = False
  24. End If
  25. Next
  26. If creatTool Then CommandBars.Add "CorelVBA"
  27. With CommandBars.Item("CorelVBA")
  28. .Visible = True
  29. Set ctl = .Controls.AddCustomButton(cdrCmdCategoryMacros, "LYVBA.CorelVBA.Start")
  30. ver = Val(Version)
  31. If ver < 17 Then
  32. ctl.SetCustomIcon "C:\TSP\LYVBA.ico"
  33. Else
  34. ctl.SetIcon2 ("guid://a8e62a7a-d5d2-4a05-8d5d-e07d6bd21993") '// 输出中心图标
  35. End If
  36. Set ctl2 = .Controls.AddCustomButton(cdrCmdCategoryMacros, "LYVBA.CorelVBA.Start_Dimension")
  37. ctl2.SetIcon2 ("guid://b4b9632a-248b-4d80-a62d-88804e50a955") '// 标尺工具图标
  38. Set ctl3 = .Controls.AddCustomButton(cdrCmdCategoryMacros, "LinesTool.lines.start")
  39. ctl3.SetIcon2 ("guid://d2fdc0d9-09f8-4948-944c-4297395c05b7")
  40. Set ctl4 = .Controls.AddCustomButton(cdrCmdCategoryMacros, "ZeroBase.Hello_VBA.run")
  41. ctl4.SetIcon2 ("guid://1a0b1202-d0ef-4fe7-8a95-ac7617b30703")
  42. End With
  43. End If
  44. ErrorHandler:
  45. End Sub