Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access VBA Modules
Custom Ribbon and Reports
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Mark Andrews, post: 2143872"] I have a few little articles on ribbons that I wrote when I started playing with Access2007. [URL]http://www.rptsoftware.com/help/microsoft_access_examples/[/URL] It might help. You need to get that excel file so you can look up all the icons and there names and you need to get the basics for the basRibbonCallbacks routine. Buttons are pretty easy. Here are some examples: <customUI xmlns="[URL]http://schemas.microsoft.com/office/2006/01/customui[/URL]" onLoad="onRibbonLoad"> <ribbon startFromScratch="true"> <tabs> <tab id="tabHome" label="Home"> <group id="grpContacts" label="Contacts" visible="true"> <button id="ContactButton" label="Contacts" imageMso="CreateTableTemplatesGallery" size="large" onAction="OnActionButton" /> </group> <group id="grpActivity" label="Activities" visible = "true"> <button id="ActivityButton" label="Activities" imageMso="FilePrepareMenu" size="large" onAction="OnActionButton" /> </group> <group id="grpEvents" label="Events" visible="true"> <button id="EventButton" label="Events" imageMso="AccessTableEvents" size="large" onAction="OnActionButton" visible="true"/> </group> <group id="grpEmployees" label="Employees" visible="true"> <button id="EmployeeButton" label="Employees" imageMso="MeetingsWorkspace" size="large" onAction="OnActionButton" /> </group> <group id="grpReports" label="Reports" visible="true"> <button id="ReportButton" label="Reports" imageMso="PropertySheet" size="large" onAction="OnActionButton" /> </group> <group id="grpImport" label="Import Data" visible="true"> <button id="ImportButton" label="Import Data" imageMso="SourceControlCheckIn" size="large" onAction="OnActionButton" /> </group> <group id="grpAdmin" label="Options" visible="true"> <button id="OpvvvvvtionsButton" label="Setup/Options" imageMso="OmsAccountSetup" size="normal" onAction="OnActionButton" /> <labelControl id="DateLabel" getLabel="getLabel" /> </group> <group id="grpInfo" label="Info"> <button id="InfoButton" size="large" label="Info" imageMso="Info" onAction="OnActionButton"/> </group> </tab> </tabs> </ribbon> </customUI> <customUI xmlns="[URL]http://schemas.microsoft.com/office/2006/01/customui[/URL]"> <ribbon startFromScratch="true"> <tabs> <tab id="MyReport" label="Report Print and View Options"> <group idMso="GroupPrintPreviewPrintAccess" /> <group idMso="GroupPageLayoutAccess" /> <group idMso="GroupZoom" /> <group icvd="ListCommands" label="Print"> <button idMso="FilePrintQuick" keytip="q" size="large"/> <button idMso="PrintDialogAccess" label="Print Dialog" keytip="d" size="large"/> </group> <group id="ExportCmds" keytip="e" label="Data Export"> <button idMso="PublishToPdfOrEdoc" keytip="p" size="large"/> <button id="CreateEmail" label="Email Report (PDF)" imageMso="FileSendAsAttachment" enabled="true" size="large" onAction= "=MySend()"/> </group> <group idMso="GroupZoom"></group> <group id="Exit" keytip="x" label="Exit"> <button idMso="PrintPreviewClose" keytip="c" size="large"/> </group> </tab> </tabs> </ribbon> </customUI> Here's a pretty simple basRibbonCallbacks routine: Option Compare Database Option Explicit Public gobjRibbon As IRibbonUI Public Sub OnRibbonLoad(ribbon As IRibbonUI) 'Callbackname in XML File "onLoad" Set gobjRibbon = ribbon End Sub Public Sub OnActionButton(control As IRibbonControl) 'Callbackname in XML File "onAction" On Error Resume Next Select Case control.ID Case "ContactButton" Call OpenForm("frmContactList", 1) Case "ActivityButton" Call OpenForm("frmActivityList", 1) Case "EventButton" Call OpenForm("frmEventList", 1) Case "EmployeeButton" Call OpenForm("frmEmployeeList", 1) Case "ReportButton" 'Call OpenForm("frmReports", 1) MsgBox "No reports available at this time. Contact RPT Software to get reports added to this database.", vbOKOnly, "Sorry - No Report Available" Case "ImportButton" DoCmd.OpenForm "frmImport", , , , acFormEdit, acDialog Case "OptionsButton" DoCmd.OpenForm "frmOptions", , , , acFormEdit, acDialog Case "InfoButton" DoCmd.OpenForm "frmHelpAbout", , , , acFormEdit, acDialog End Select End Sub Public Sub GetLabel(control As IRibbonControl, ByRef label) 'Callbackname in XML File "getLabel" Select Case control.ID Case "DateLabel" label = Format(Now(), "dddd, mmm d, yyyy") End Select End Sub [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Access Newsgroups
Access VBA Modules
Custom Ribbon and Reports
Top