A 'hello world' VBA program

From Ribbon Commander Documentation
Revision as of 17:56, 10 March 2013 by Rxdff15551 bb53 (Talk | contribs) (Creating a tab)

Jump to: navigation, search

Creating a tab

Enter the code below in a standard VBA module and run it to create a tab labeled 'My First Tab'

Public Sub CreateMyUI()
 
    ' Get a reference to the default rxCustomUI instance
    Dim myCustomUI As rxCustomUI
    Set myCustomUI = rxCustomUI.defaultInstance
 
    ' Create a new tab
    Dim myTab As rxTab
    Set myTab = myCustomUI.ribbon.tabs.Add(New rxTab)
 
    ' Give the new tab a label
    myTab.Label = "My First Tab"
 
 
    ' Render the UI
    myCustomUI.Refresh
 
End Sub