Print Page | Close Window

SOLVED. looping through commandbar actions

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11844
Printed Date: 07 October 2024 at 2:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED. looping through commandbar actions
Posted By: marcel
Subject: SOLVED. looping through commandbar actions
Date Posted: 16 August 2008 at 4:40am
Hi all,
 
I have commandbars with ActionsEnabled true. For a translation tool I want to loop through all actions and translate the Caption ad Tooltips.
 
The translation tool doesn't know anything of the indexes of the action items.
 
How can I loop through all actions?
 
Something like this?
 
For i = 1 to CommandBars:Actions:Count Do:
   CommandBars:Actions:Item(i).Caption = "New TranslatedValue";
End;
 
But that don't seems to work. How can I access all actioncontrols without knowing their index values?
 
Thanks for help!
 
Greetz,
Marcel



Replies:
Posted By: Oleg
Date Posted: 18 August 2008 at 2:16am
Hi,
 
For VB6 it looks like
    Dim a As CommandBarAction
    For Each a In CommandBars.Actions
        Debug.Print a.Caption
    Next
   


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Aaron
Date Posted: 18 August 2008 at 10:06am
Originally posted by marcel marcel wrote:

Hi all,
 
[...]
 
Something like this?
 
For i = 1 to CommandBars:Actions:Count Do:
   CommandBars:Actions:Item(i).Caption = "New TranslatedValue";
End;
 
Greetz,
Marcel
 
Hi,
 
Try this:
 
For i = 1 to CommandBars:Actions:Count Do:
   CommandBars:Actions:Action(i).Caption = "New TranslatedValue";
End;
 
 
I don't know what language you use, so I suggest you look at post: https://forum.codejock.com/forum_posts.asp?TID=11225 - https://forum.codejock.com/forum_posts.asp?TID=11225  first and if your issue is solved change your topic description into SOLVED: <your topic description>
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: marcel
Date Posted: 20 August 2008 at 4:46pm
Solved!
 
I can retrieve all commandbar controls by:
CommandBars:Item(i):Controls:Item(i2):Caption
 
i = number of the commandbar
i2 = number of the control in the Controls collection of the commandbar
 
That's enough for the translation tool although their are duplicated values of controls both on the menu and any commandbar.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net