
FWIW, I use the following ribbon XML for all my databases' reports:
CODE
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="onRibbonLoad6">
<ribbon startFromScratch="true">
<tabs>
<tab id="grpRprt1" label="File">
<group id="grpPrint" label="Print" visible="true">
<button id="PrntRpt" size="large" label="Print" imageMso="PrintDialogAccess" onAction="=PrintDialog()"/>
</group>
<group id="grpClgrpRprt2" label="Close">
<button id="PPrClose" label="Close" imageMso="PrintPreviewClose" size="large" onAction="OnCloseReport"/>
</group>
<group id="grpRprt3" label="Export">
<control idMso="ExportExcel" visible="true" size="large" />
<separator id="sprtrRpt1" />
<control idMso="ExportWord" visible="true" size="large" />
<separator id="sprtrRpt2" />
<control idMso="ExportTextFile" visible="true" size="large" />
<separator id="sprtrRpt3" />
<button idMso="FileSaveAsPdfOrXps" visible="true" size="large" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
The custom command for the print dialog box allows the db to determine if the report has actually been printed or not (via the intPrinted global variable) - or at least sent to the print queue. While the custom close command calls a DoEvents command that allows the report ribbon to be replaced quickly by the form ribbon.
CODE
Public Function PrintDialog()
On Error GoTo err_PrintDialog
'Opens windows print dialog box,
'If printed (ie NOT Cancelled) sets global variable intPrinted to -1 and closes report
DoCmd.RunCommand acCmdPrint
intPrinted = -1
DoCmd.Close acReport, Screen.ActiveReport.Name
exit_PrintDialog:
Exit Function
err_PrintDialog:
Resume exit_PrintDialog
End Function
Sub OnCloseReport(ctrl As IRibbonControl)
On Error GoTo err_proc
Application.Echo False
DoCmd.Close acReport, Screen.ActiveReport.Name
DoEvents
exit_proc:
Application.Echo True
Exit Sub
err_proc:
MsgBox Err.Description, , strTitle
Resume exit_proc
End Sub
hth