Full Version: Runtime "hides" My Export To Word Buttons On My Custom Ribbon
UtterAccess Discussion Forums > Microsoft® Access > Access Runtime, Packaging & Deployment
rsindle
From the "nothing's ever easy department."

I am trying to create an .accde file which I rename to .accdr to give to users.
My custom ribbon (which works great with the .accdb or .accde) hides the "export to word" button when running in runtime.

WHY?!? Why are they doing this to us? Is there a reason why? and more im pullhair.gif portantly, is there a workaround.
I really need the "export to word" button to be there.

thanks,
Rob
pere_de_chipstick
Hi Rob

Add the line

visible="true"

to the comand button line in your XML.

hth

Edit:
Discussion about it in this thread.
rsindle
Thanks again, Bernie.

My XML line looks like THIS now:

<control idMso="ExportWord" label="Export to Word" enabled="true" visible = "true"/>

instead of this:

<control idMso="ExportWord" label="Export to Word" enabled="true"/>


Works great! Thanks!
Rob
pere_de_chipstick
yw.gif

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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.