Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Changing RibbonBar Captions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing RibbonBar Captions

 Post Reply Post Reply
Author
Message
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Topic: Changing RibbonBar Captions
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2006 at 7:56am

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
in the biginning of file to see if these constants are visible.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2006 at 7:57am

also replace

Dim ControlRibbonButton As CommandBarPopup

to

Dim ControlRibbonButton As CommandBarControl

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2006 at 7:58am
Hmm,
I'm not sure why you don't get type mismatch.

Try:
Dim ControlRibbonButton As CommandBarControl
Back to Top
jcollier View Drop Down
Senior Member
Senior Member


Joined: 15 February 2006
Status: Offline
Points: 250
Post Options Post Options   Thanks (0) Thanks(0)   Quote jcollier Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2006 at 3:59pm
Changing to Dim ControlRibbonButton as CommandBarControl worked.

My contants were fine, didn't have to change anything.

Thanks!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.