'To create and register a shortcut menu:
registerID = SwApp.RegisterThirdPartyPopupMenu()
'To add an actionable menu item to a shortcut menu:
resultCode = SwApp.AddItemToThirdPartyPopupMenu2(
registerID,
CInt(swDocumentTypes_e.swDocPART),
"Test1",
addinID,
"TestCallback",
"EnableTest",
"",
"Test1",
cmdGroup.SmallMainIcon,
CInt(swMenuItemType_e.swMenuItemType_Default))
'To add a separator bar to a shortcut menu
resultCode = SwApp.AddItemToThirdPartyPopupMenu2(
registerID,
CInt(swDocumentTypes_e.swDocPART),
"Separator1",
addinID
"",
"",
"",
"",
"",
CInt(swMenuItemType_e.swMenuItemType_Separator))
'To add a section title or break to a shortcut menu:
resultCode = SwApp.AddItemToThirdPartyPopupMenu2(
registerID,
CInt(swDocumentTypes_e.swDocPART),
"Menu Break",
addinID,
"",
"",
"",
"",
"",
CInt(swMenuItemType_e.swMenuItemType_Break))
'To add an icon to the menu bar above a shortcut menu:
resultCode = SwApp.AddItemToThirdPartyPopupMenu2(
registerID,
CInt(swDocumentTypes_e.swDocPART),
"",
addinID,
"TestCallback",
"EnableTest",
"",
"NoOp",
cmdGroup.SmallMainIcon,
CInt(swMenuItemType_e.swMenuItemType_Default)) |