Avatar of JohnRawlo
JohnRawlo
Flag for France asked on

Problems shifting Command Bars in MS Access 2003/2007 to customized ribbons in Office 2013

Hi all,

I'm in the process of shifting menus and tool bars originally built in earlier versions of MS Access to customized ribbons in MS Access 2013 - mainly because there's no choice. The application had about 5 menu bars (with tool bars) and I've been looking at redesigning things simply because of the room the ribbons take and also the way they work. So one of the first questions I have is:

Is there an advantage having 1 ribbon with multiple tabs as opposed to 5 ribbons with 1 tab each. In either case there's a fair bit of making visible and not visible tabs or groups and perhaps controls too.

This sort of leads to the next question as since I've used code from the IDBE Avenius software I can't seem to find much in the way of examples in using multiple ribbons or even multiple tabs in the same ribbon. The code you can download makes sense for simple changes to ribbons but from what I can see not much more than that. Am I missing something ?

Thanks for any help or suggestions.

Regards,
John
Microsoft ApplicationsMicrosoft Development

Avatar of undefined
Last Comment
JohnRawlo

8/22/2022 - Mon
SOLUTION
AndyAinscow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Chris Bottomley

IN the ribbon approach as I have used it you set a tag for each ribbon element, (standard syntax)  and as long as you design the tags appropriately you van make visibility flexible via the getvisible callback.

For example I use one Ribbon and then mode groups according to context and in each group there are buttons that further subdivide according to context

The enclosed file is a simple <g> example which demonstrates within a group the moding of one or both controls and the group is itself one of the controls made visible/invisible.

Chris
Chris Bottomley

HM when it gave the docm option I thought it would upload!
getVisible.docm.zip
ASKER CERTIFIED SOLUTION
Chris Bottomley

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
JohnRawlo

ASKER
Thanks both Andy and Chris. It's a good method you've got Chris for your situation however I need to set up ribbons/tabs based on user accessibility and contextual situations. Hence I'm not sure that I would be able to use that method as the permutations would be large. Also the enabling or making visible the tabs/groups/controls seems activated by the ribbon itself which I understand can be called by using the Invalidate method on the IURibbon object that's been created. This seems to work ok in simple situations but in more involved situations such as making some tabs and groups invisible and some control invisible or disabled, this seems more complicated as almost each object needs to have it's own variable so that the ribbon knows what to do with it. Maybe I'm missing something here but in what I've seen so far that seems to be the way it works.

Does that make sense ? Maybe I should load a small example to illustrate my point.

Regards,
John
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Chris Bottomley

Ah

Sorry but I did post from my mobile but it doesn't seem to have uploaded.

1. The selectivity can be triggered by any event so for example I trigger in my documents on open and change of the activedocument.

2. As you have seen with appropriate naming you can make combinations of tabs/groups/objects visible, for example if you have a numeric schema for your tags (i.e. mode 1 then display abc, mode 2 bcf then it can be done that way.

3. I am unaware of any alternative to the validate methd and hence some variant of tag naming is essential.

4. A sample file could well help.

Chris
JohnRawlo

ASKER
Hi there,
Sorry to take so long to get back to you all but there's been a lot on (as usual) and I've been prompted by the system multiple times now !
In all that time I've actually spent a bit of time on the ribbons and the application and now start to have some sort of reasonable things that works. However I'll share with you some of the things I've discovered to see what you think.

1. Firstly in the applications I maintain the visibility and whether they're enabled or not is based on
    a) who the user is
    b) what the ribbon control is linked to in terms of application functionality
    c) where the user is in the application

a) and b) are pretty obvious but with c) there comes the necessity to "invalidate" a control or the ribbon itself (usually the latter from what I've found) and this is done in code from potentially any where in the application. Hence in reality I've found that the application needs to know obviously a) which is static in the sense that it's always that way for the life of the application for that user, obviously b) and some application variables which denote where the user is in the application which can dictate whether certain controls are visible or enabled. So in the xml found I've found that the control id is usually sufficient and that to include a tag is not always usable in my applications.

2. I've found that when the ribbon or control is "invalidated" then this does NOT trigger the code to call the GetEnabled or GetVisible (or other) functions UNTIL"visibility" is required. So when opening a form in MS Access and there is code for the Open, Load and Activate events (which runs in that order), even though the ribbon may have been invalidated in the Open event, the ribbon control functions are not called until the end of the activate event which involves the visibility of the form. This sort of makes sense but at the same time you have to be aware otherwise the code can potentially expect "things" have been done by the invalidation method which in fact is not true until the visibility of the form is active.

Hope this makes some sort of sense and would welcome any comments.

Thanks and regards,
John