
Originally Posted by
isladogs
.... I'm posting now to remind you that the easiest solution is to completely remove the ribbon except for particular situations e.g. Print ribbon for reports in Print Preview.
Have a look at my example database:
Control the Application Interface where I do this and also hide the application interface. The example app shows lots of different scenarios.
NOTE: In older versions such as 2010, the QAT was fully linked to the ribbon. You either had both or neither.
This was changed a few tears ago and they are now handled separately at least in 365 (not sure about e.g. 2021). Unfortunately there is almost no info online on managing the QAT in code.
Hi Colin. Thanks for the response. We are using Office 365. I've had a look at you Control Application Interface. Lot's of nice stuff there that I can play with. However I don't see a solution in regards to the QAT.
I already have the ribbon disabled globally
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo
and only activate it when a report opens with the reports OnLoad event, and close it with the reports OnClose event. Tedious if I have to do this for every report..
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarYes
The problem is that when the ribbon is enabled, the QAT is also enabled loaded with commands I don't want.
The best solution I've been able to come up with is to "grey out" the commands in the QAT with my custom ribbon. Teasingly it still has the Hide Quick Application Toolbar Option, for which I haven't been able to find a idMso
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="tabReportPrint" label="Report Print">
<group id="grpPrint" label="Printing">
<button id="btnQuickPrint"
label="Quick Print"
size="large"
imageMso="FilePrintQuick"
onAction="QuickPrintCallback" />
<button id="btnExportPDF"
label="Export as PDF"
size="large"
imageMso="FileSaveAsPdfOrXps"
onAction="ExportPDFCallback" />
</group>
</tab>
</tabs>
<!-- Empty QAT: greys out QAT strip and blocks customization -->
<qat/>
</ribbon>
<!-- Remove Backstage (File menu) options -->
<backstage>
<tab idMso="TabInfo" visible="false"/>
<tab idMso="TabRecent" visible="false"/>
<tab idMso="TabNew" visible="false"/>
<tab idMso="TabOpen" visible="false"/>
<tab idMso="TabSave" visible="false"/>
<tab idMso="TabPrint" visible="false"/>
<tab idMso="TabShare" visible="false"/>
<tab idMso="TabHelp" visible="false"/>
<tab idMso="TabOptions" visible="false"/>
<tab idMso="TabClose" visible="false"/>
</backstage>
</customUI>