Changing Menu Captions |
Post Reply |
Author | |
rdtcgriffin
Newbie Joined: 18 March 2004 Status: Offline Points: 19 |
Post Options
Thanks(0)
Posted: 19 March 2004 at 3:01am |
Hello! I have the following code to create the menu: Set ControlView = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 1, "File", -1, False) Then, later on I would lile to change the captions of the menu. For the main menu (File) I can change teh caption using: CommandBars.ActiveMenuBar.Controls.Item(1).Caption = "FileX" But for it's submenus, I get "Invalid procedure call or argument" error message when I try this: What method should I use so that I can change the captions? Also, is the solution the same for toolbars? Thanks in advance! Rommel
|
|
SuperMario
Admin Group Joined: 14 February 2004 Status: Offline Points: 18057 |
Post Options
Thanks(0)
|
Just assign an Id to each control you will search for and use it in the FindControl method:
Set ControlFile = CommandBars.ActiveMenuBar.FindControl(,ID_FILE_OPEN, ,True) ControlFile.Caption = "Open File" |
|
rdtcgriffin
Newbie Joined: 18 March 2004 Status: Offline Points: 19 |
Post Options
Thanks(0)
|
Thanks! I can now change the captions of the buttons (xtpControlButton). But how do I change the caption of type xtpControlPopup? I get "Run-time error 91 Object variable or With block not set" when I use the popup's ID for the code you gave above. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
For popup control you must additional assign its ID: Set ControlView = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 10, "File", -1, False) ControlView .Id = 10 |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
rdtcgriffin
Newbie Joined: 18 March 2004 Status: Offline Points: 19 |
Post Options
Thanks(0)
|
OK thanks. Got it wotking now
Edited by rdtcgriffin |
|
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 |