473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

AC2007 - Show Built-In Ribbon For Report Only

Hi,

I'm having issues with AC2007 custom ribbons.

I'm building an AC2007 runtime app which has a custom ribbon (called CommandsDisabledHideRibbon) set as the default db ribbon name (see XML at end of post). The aim is to hide as much of the Access interface as possible.

CommandsDisabledHideRibbon ribbon XML (verified as well-formed by the Office 2007 Custom UI Editor):

Expand|Select|Wrap|Line Numbers
  1. <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  2.  
  3. <commands>
  4. <command idMso="FileNewDatabase" enabled="false"/>
  5. <command idMso="FileCloseDatabase" enabled="false"/>
  6. <command idMso="ApplicationOptionsDialog" enabled="false"/>
  7. <command idMso="FileExit" enabled="false"/>
  8. <command idMso="Help" enabled="false"/>
  9. </commands>
  10.  
  11. <ribbon startFromScratch="true">
  12. </ribbon>
  13.  
  14. </customUI>
The app has one report. When that report opens, I want to be able to show the Print Preview ribbon when the report is showing, and hide it when it's done.

I have 2 issues here.

1) I need to be able to load a ribbon when the report opens.

I have this code:

Expand|Select|Wrap|Line Numbers
  1. Public Sub ShowCustomRibbon(strRibbonName As String)
  2.  
  3.   Dim strXML As String
  4.  
  5. On Error GoTo Err_Procedure
  6.  
  7. 'Get ribbon XML.
  8.   strXML = DLookup("[RibbonXML]", "USysRibbons", "[RibbonName] = '" & strRibbonName & "'")
  9. 'Load ribbon.
  10.   Application.LoadCustomUI strRibbonName, strXML
  11. 'Show ribbon.
  12.   CurrentProject.Properties("CustomRibbonID") = strRibbonName
  13.  
  14. Resume_Procedure:
  15.   On Error GoTo 0
  16.   Exit Sub
  17.  
  18. Err_Procedure:
  19.   MsgBox "ShowCustomRibbon Error: " & err.Number & " " & err.Description
  20.   GoTo Resume_Procedure
  21.  
  22. End Sub
but it causes an error both loading and showing the ribbon.

2) I'm assuming that to show the print preview ribbon, I'll need to create a custom ribbon in XML that mirrors its functionality. Does anyone know if the XML for the built-in ribbons is available? Or can you just show a built-in one easily?

3) The Open option is still available from the Office button, even though I believe my XML above should disable it.

I'm an Access developer, and can usually find the answers to my problems in 10 mins on Google, but there seems to be a lack of useful info about these issues.

Or, of course, I'm just approaching it in completely the wrong way. If there's a better way, please let me know!

Thanks in advance.
Jun 25 '08 #1
4 7540
Apologies, the answer to 1) was on these forums at

http://bytes.com/forum/thread772071-ribbon.html

And I had 3 issues, not 2.

So, anyone know the easiest way to show a ribbon with the Print Preview functions available?

And why my Open menu item is still available?

Thanks again
Jun 25 '08 #2
Megalog
378 Expert 256MB
Hi there..
I'll have to get back to you on the answer for the Print Preview tab.. I tried a few things quickly on my end and it didnt work... But as far as disabling/hiding native access commands, I use this at the beginning of my custom ribbon. The end-user only gets a 'print' menu, and 'close database' option when they click the Office button.

After re-reading your post, it seems you're not hiding the Open command, just the New. Add the FileOpenDatabase command and you should be set.

Expand|Select|Wrap|Line Numbers
  1. <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  2.  <ribbon startFromScratch="true">
  3.   <officeMenu>
  4.    <button idMso="FileOpenDatabase" visible="false"/>
  5.    <button idMso="FileNewDatabase" visible="false"/>
  6.    <splitButton idMso="FileSaveAsMenuAccess" visible="false" />
  7.    <splitButton idMso="FilePrintMenu" visible="true" />
  8.   </officeMenu>
  9. <insert rest of your custom ribbon code here, if any>
  10. </ribbon>
  11. </customUI>
Jun 25 '08 #3
Megalog
378 Expert 256MB
As for your Print Preview commands.. you can manually add the native access groups that show up under the Print Preview tab. Some or most of these commands may be disabled until you're actually in print preview mode.

Here are the group names:

GroupPrintPreviewPrintAccess
GroupPageLayoutAccess
GroupZoom
GroupPrintPreviewData
GroupPrintPreviewClosePreview

So if you wanted to add the simple 'Print' button group, and the zoom commands group, in their own new tab, you would use this:
Expand|Select|Wrap|Line Numbers
  1.   <tabs>
  2.   <tab id="tabPrintPreview" label="Custom Print Preview">
  3.     <group idMso="GroupPrintPreviewPrintAccess"></group>
  4.     <group idMso="GroupZoom"></group>
  5.   </tab>
  6.  </tabs>
You can also add the native commands separately too, if you want to create a custom group.

If I find out how to get the default access PP tab to show up, or to permanently make it visible, I'll let you know.
Jun 25 '08 #4
Thanks Megalog, that looks like exactly what I'm after with the Print Preview issue.

And for pointing out what should have been blatantly obvious about the Open command!

I'll give it a go later today, and let everyone know how it went.
Jun 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: JimmyT | last post by:
I just configured and installed 2.3.4 and noticed there is no datetime module. I noticed there is a datetimemodule.c file that did not get built (ie no object file). Is there something I need to...
1
by: Alex Elbert | last post by:
Hi I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML...
0
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
by: Mark | last post by:
Is there a way to execute a statement that is built dynamically by a .NET application. For example I have a loop that is reading values from a database and I want to do something like the...
1
by: William | last post by:
Looking for a pre built dotnet corporate or small business website template.
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
13
by: Tomasz Jastrzebski | last post by:
Helo All, The problem: GridView control does not render at all (header/footer) when the data source is empty. I have seen a similar question posted already, but I just can not believe there is...
3
by: drewj840 | last post by:
I built a Windows service that sweeps a set of folders every 60 seconds and puts the files into a SQL Server database. I am creating a second service that will delete this set of folders and recreate...
21
by: =?ISO-8859-1?Q?Fad=A5?= | last post by:
Hello guys, I want to do kinda of an A/B split testing on a website I run. I just created a new version but I need to keep both version running and see which one will perform better. First, I'm...
4
by: =?Utf-8?B?QmVu?= | last post by:
Hi all, My environment is VS2008,C#. I am experimenting with C#. I have a form with a few controls on it. Two of them are buttons but for some reason, they do not show up at all during run...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.