vba11-2.txt

来自「本书给出了AO的常用的VAB代码 可能是初学者很好的一本参考书」· 文本 代码 · 共 19 行

TXT
19
字号
Public Sub NewMenu()
  ' Find the Main menu bar.
  Dim pMainMenuBar As ICommandBar
  Set pMainMenuBar = ThisDocument.CommandBars. _
  Find(ArcID.MainMenu)
    
  ' Create the new menu called "MyMenu"
  ' on the MainMenuBar.
  Dim pNewMenu As ICommandBar
  Set pNewMenu = pMainMenuBar.CreateMenu("MyMenu")
    
  ' Add a built in command to the new menu.
  pNewMenu.Add ArcID.File_AddData
    
  ' Add your VBA macro to the new menu.
  pNewMenu.CreateMacroItem "MyCommand", 0, _
  "Project.ThisDocument.ShowTime"
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?