Ribbons design in Ms Access 2016

Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc used Ask the Experts™
on
Just for consultation purpose , I want to maintain the in-belt Ribbon preview button and at the same time adding my excel export other programs export function in my ms access app.kindly see whether this is okay with you.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon> 
<tabs>
            <tab id="grpRprt1" label="Export Reports">
                
                <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>

Open in new window


I have also noticed that the export is using 97 to 2003 is it possible to change it so that it starts from 2003 to 2016?

Regards

Chris
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Commented:
Does it work? If so, then there's no problem adding this to the Ribbon.

What do you mean by "using 97 to 2003"? Do you mean that when you export, the resultant File Dialog box shows those values in the File Type section? If so then no, you can't change those.

You could create your own Export function that specifies the format, but that's a separate question.
John TsioumprisSoftware & Systems Engineer

Commented:
You would better with a custom function assigned to the Ribbon button
 <button id="ExportToXLSX"  visible="true" size="large" imagemso = "ChartShowData"
onAction="exportToXLSX" />

Open in new window

and the function
Public Function exportToXLSX(ctl As IRibbonControl)
Dim curPath As String
curPath = CurrentProject.Path & "\YourExcel"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "YourTable", curpath, True

End Function

Open in new window

Last but not least you need a reference to Microsoft Office 16 Object Library (change 16 to your version)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial