ThisMacroStorage.cls 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. For Each Item In CommandBars
  19. If Item.Name = "CorelVBA" Then
  20. creatTool = False
  21. End If
  22. Next
  23. If creatTool Then CommandBars.Add "CorelVBA"
  24. With CommandBars.Item("CorelVBA")
  25. .Visible = True
  26. Set ctl = .Controls.AddCustomButton(cdrCmdCategoryMacros, "LYVBA.CorelVBA.Start")
  27. ' ctl.SetIcon2 ("guid://46327bd4-8bad-41c5-aba1-efa770b8e2c8")
  28. ctl.SetCustomIcon "C:\TSP\LYVBA.ico"
  29. End With
  30. End If
  31. ErrorHandler:
  32. End Sub