![]() |
Changing RibbonBar Captions |
Post Reply ![]() |
Author | |
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() Posted: 21 March 2006 at 3:46pm |
I am trying to change the caption of one of my submenus that expands down from a RibbonBar.
Can anyone help with the following code? private sub SetUpRibbonBar Dim tabBatches As RibbonTab Dim RibbonBar As RibbonBar Dim GroupBatches As RibbonGroup Dim ControlRibbonButton As CommandBarPopup Set RibbonBar = CommandBars.AddRibbonBar("MainRibbon") Set tabBatches = RibbonBar.InsertTab(0, "Batches") Set GroupBatches = tabBatches.Groups.AddGroup("Batch Functions") Set ControlRibbonButton = GroupBatches.Add(xtpControlSplitButtonPopup, ID_CREATEBATCH, "Create") ControlRibbonButton.CommandBar.Controls.Add xtpControlButton, ID_CREATEBATCH, "Create Batch" ControlRibbonButton.CommandBar.Controls.Add xtpControlButton, 0, "Create Imageless Batch" GroupBatches.Add xtpControlButton, ID_CLOSEBATCH, "Close Batch" Set GroupBatches = tabBatches.Groups.AddGroup("Queues") Set ControlRibbonButton = GroupBatches.Add(xtpControlSplitButtonPopup, ID_QUEUES, "Queues") ControlRibbonButton.CommandBar.Controls.Add xtpControlButton, ID_INPRODUCTION, "In Production", -1, False ControlRibbonButton.CommandBar.Controls.Add xtpControlButton, ID_INBILLING, "In Billing", -1, False CommandBars.Icons = imCommandBar.Icons Set ControlRibbonButton = CommandBars.FindControl(xtpControlButton, ID_INPRODUCTION, , True) Debug.Print ControlRibbonButton.Caption '<----Returns "Queues". I want it to return "In Production" End Sub ID_QUEUES = 9 ID_INPRODUCTION = 12 I'm sure it's something simple but I can't seem to get it. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello, Just tried to change our sample and it worked as expected. I sure the problem in ID_QUEUES and ID_INPRODUCTION - may be they are declared somewhere as private.
Declare them as Public Const ID_QUEUES = 9 Public Const ID_INPRODUCTION = 12
try to add Option Explicit |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
also replace Dim ControlRibbonButton As CommandBarPopup to Dim ControlRibbonButton As CommandBarControl |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Hmm,
I'm not sure why you don't get type mismatch. Try: Dim ControlRibbonButton As CommandBarControl |
|
![]() |
|
jcollier ![]() Senior Member ![]() Joined: 15 February 2006 Status: Offline Points: 250 |
![]() ![]() ![]() ![]() ![]() |
Changing to Dim ControlRibbonButton as CommandBarControl worked.
My contants were fine, didn't have to change anything. Thanks! |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |