How to : Add Ribbon Tab, Panels and Button ??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have already write a Macro in VBA which functions as a button. I want to add a new tab with panels and buttons in these panels. So what I suppose to do is:
1/ Create tab and panels
2/ Add button in panels
This is the code I write to do the first step:
[code]
Dim oAsmDoc As AssemblyDocument
oAsmDoc = mApp.ActiveDocument
' Get the part ribbon
Dim oAsmRibbon As Ribbon
oAsmRibbon = mApp.UserInterfaceManager.Ribbons.Item("Assembly")
' Create a new tab before the Assemble Tab
Dim oProTab As RibbonTab
oProTab = oAsmRibbon.RibbonTabs.Add("Pro", "Id_TabPro", "ClientId12345", "id_TabAssemble", True, False)
oProTab.Visible = True
'Create a new panel on the Promecon tab
Dim oPanel(4) As RibbonPanel
oPanel(1) = oProTab.RibbonPanels.Add("Model", "id_PanelA_PromeconModel", "ClientId12345")
oPanel(2) = oProTab.RibbonPanels.Add("Drawing", "id_PanelA_PromeconDrawing", "ClientId12345")
oPanel(3) = oProTab.RibbonPanels.Add("BonusTools", "id_PanelA_PromeconBonusTools", "ClientId12345")
oPanel(4) = oProTab.RibbonPanels.Add("Report", "id_PanelA_PromeconReport", "ClientId12345")
[end code]
The fault exists in the bold line. I think the problem is the ClientId. In the API Online Class Material, they say that "ClientId - Input String that uniquely identifies the client. This is the CLSID of the AddIn in a string form, e.g. "{C9A6C580-3817-11D0-BE4E-080036E87B02}". It is not recommended to pass a “dummy” string or a null string.". But I cann't find out what ClientId is suitable and reasonable.
2/ How to convert an VBA modules to a button and add it to panel
Thank you so much!