Access 2007 Ribbons

A

AG

Does anyone know of a way to set the Ribbon Name via code? I can't seem to
find it anywhere.

Also, LoadCustomUI will load a custom menu. Is there any way to un-load it
without closing the database?

Thanks,
 
A

Asad Ali

Hi to all Group Member

yesterday I was searching from google som vedios
I hve just found a lagrest and greatest group of
online vedios on internet

which Is on daily bases
it updates vedios on daily bases
so must check it to keep intouch with the world to examine what is happing
in side our world

the link is
http://obm.itnews.googlepages.com

regards and thnanks

Asad ali
manager :E-Idea google Group
cell:+923217507176
Email:[email protected]
web:http://obm.itnews.googlepages.com
 
A

Albert D. Kallal

AG said:
Does anyone know of a way to set the Ribbon Name via code? I can't seem to
find it anywhere.

Just sets the forms "ribbon" property in code:

eg:

me.Ribbon = "name of ribbon"

For the most part, you can just set the forms ribbon in design mode.
Thus if you have 4 forms open (each needing different ribbon), then you
don't
have to write code to "switch" and maintain all those open
ribbons...access will do it for (eg: when users switch to a different form
the ribbon specified for that form will show).
Also, LoadCustomUI will load a custom menu. Is there any way to un-load it
without closing the database?

No, but during development it is a pain to have to exit and then re-enter
the
application. My simple solution was to put a compact + repair in the
shortcut menu. Thus during development, I just hold down the shift key, and
click the compact+repair button and I able to continue working as if I
never left the database. A "must" do setting when working with ribbons, and
it a fast single click to reset ribbions..
 
A

Albert D. Kallal

me.Ribbon = "name of ribbon"


Should read

Me.ribbonName = "name of ribbon"
 
A

AG

Thanks Albert.
Sorry I wasn't clear.
I understand about setting the ribbonname for forms.
I was referring to the 'Ribbon Name' for the application, as set via Access
Options > Current Database > Ribbon Name.
Just figured it out though.
It is a database property named 'CustomRibbonID' which can be set just like
any other database property.
CurrentDb.Properties("CustomRibbonID") = "MyRibbon"
It would be nice it it was documented though.

I still would like to know how to unload a ribbon without closing and
reopening the database.
My goal here is to create a way to switch from showing all built-in ribbon
tabs combined with my custom tabs (startFromScratch="false">), or just
showing my custom tabs (startFromScratch="true">).
That way I could have full ribbon functionality for development purposes
(and certain power users) and only my custom tabs for normal users.
If I put my ribbon xml in USysRibbons, Access loads it automatically and I
haven't found a way to change the startFromScratch attribute once loaded.
So far, the best I have come up with is to put my ribbon xml in a different
table and load it via code, looping through the table using
Application.LoadCustomUI and replacing startFromScratch="true" with
startFromScratch="false" when appropriate.
The only problem I see with that so far, is if I open the app with the shift
key, my code won't run. I need to run it manually. Not a terrible solution.

Too bad there isn't a GetStartFromStratch callback, like GetVisible, etc.
 
C

Charles Wang [MSFT]

Hi AG,
From your description, I think that you choose to have Access automatically load your customizations. In
this case, you cannot avoid closing and re-opening the database to load your custom ribbon UI. The
method Application.LoadCustomUI is the only way for resolving your current requirement, however you
said that this method would lead to your code not running. I am interesting in this. For further research,
may you answer me the following three questions:
1. Could you please elaborate what your codes are like?
2. Why do you need to run it manually?
3. What are your real intentions for these codes?

Look forward to your response.

Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
A

AG

Thanks Charles.

The code I am referring to is what I normally run via the autoexec macro
when a database opens. It sets database options, menus, etc. the way that I
want for my users, so that they have little or no access to objects other
then via my menus, forms, etc.
This would include loading my custom ribbons in the manner that I stated in
my last post.

When I say my code would not run, I mean it would not run automatically when
the database was opened when holding down the shift key. This is normal and
to be expected, as the autoexec macro does not run in that case.

If there was a way to UnLoadCustomUI, it would make things more configurable
at run time. Apparently, this is not the case.
Again, the ribbon system is a good addition, but there should be more
control available for it.

--

AG
Email: discussATadhdataDOTcom
"Charles Wang [MSFT]" said:
Hi AG,
From your description, I think that you choose to have Access
automatically load your customizations. In
this case, you cannot avoid closing and re-opening the database to load
your custom ribbon UI. The
method Application.LoadCustomUI is the only way for resolving your current
requirement, however you
said that this method would lead to your code not running. I am
interesting in this. For further research,
may you answer me the following three questions:
1. Could you please elaborate what your codes are like?
2. Why do you need to run it manually?
3. What are your real intentions for these codes?

Look forward to your response.

Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
=========================================================
 
A

Albert D. Kallal

That way I could have full ribbon functionality for development purposes
(and certain power users) and only my custom tabs for normal users.

You just have to use the shift key during startup...

Of course, during development, you will hold down the shift key so your
startup settings don't run. You then develop for awhile, and then to test in
"user" mode, you exit..and then re-enter the application without the shift
key bypassed. You will likely do this dance all day long as you run/test as
user mode, and then flip back in to developer mode (shift key used..so you
don't get the main custom menu). So, you can't develop, or really modify
things when you run your application with the startup settings...so you must
shift-by-pass them when you want to work.

And, in fact, I use alt-f4 to exit the application...the accdb file should
still be highlighted in the windows explore..so, then you hit enter key
(and, hold down shift key if you need be). This key stroke sequence and
exiting and re-entering the application will occur CONSTANTLY all day long
when you are developing.

When you finally have things just right...you create the accDE
you plan to distribute...
 
C

Charles Wang [MSFT]

Hi AG,
Thank you for your response.

I understand that your concerns and unfortunatley the current Access 2007 release does not support this
function. I recommend that you choose Products and give Microsoft your feedback from the public web
page, http://office.microsoft.com/en-us/suggestions.aspx?sitename=CL100605171033&type=0.

Your feedback will be routed to our product team and I hope that this feature will be improved in feature.

Please feel free to let us know if you have any other questions or concerns. Have a nice day!

Best regards,
Charles Wang
Microsoft Online Community Support
=========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
=========================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
=========================================================
 
A

AG

Thanks Albert,

I have come up with something that I will try for a while. I define all of
my ribbons, including custom tabs, with startFromScratch="true" and load
them via my 'appstart' code. The code will check for a specific command line
argument.
If the command line argument is present, I replace startFromScratch="true"
with "startFromScratch="false". That way, during development, I have full
ribbons as well as the custom tabs that the users will see.
I have been using that method for setting many of the database and
application options for some time, but the ribbon throws a slightly
different curve.
I typically use shortcuts to open my apps anyway due to the many versions of
Access I work in, so I can just include the command line there.
Then, when ready to test in user mode, I start the app without the shortcut.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top