Philip001
asked on
Creating ribbons in Access 2010
I have created a ribbon in Access 2010 by adding XML to a table. The ribbons show fine.
What I wish to do is put some vba code behind the buttons as follows
But access does not recognise the IRibbonUI
I've check the object explorer but cannot find IRibbonUI there either
Please can you help me know how I get IRibbonUi to show?
Which object is it a part of?
'declaration
Public objRibbon As IRibbonUI
Public Sub OnRibbonLoad(objRib As IRibbonUI)
Set objRibbon = objRib
End Sub
'our callback for the SampleButton
Public Sub OnButtonPress(ctl As IRibbonControl)
If (ctl.ID = "SampleButton") Then
MsgBox ("You have just executed the OnButtonPress callback when clicking" _
& vbCrLf & "the Ribbon SampleButton!")
End If
End Sub
What I wish to do is put some vba code behind the buttons as follows
But access does not recognise the IRibbonUI
I've check the object explorer but cannot find IRibbonUI there either
Please can you help me know how I get IRibbonUi to show?
Which object is it a part of?
'declaration
Public objRibbon As IRibbonUI
Public Sub OnRibbonLoad(objRib As IRibbonUI)
Set objRibbon = objRib
End Sub
'our callback for the SampleButton
Public Sub OnButtonPress(ctl As IRibbonControl)
If (ctl.ID = "SampleButton") Then
MsgBox ("You have just executed the OnButtonPress callback when clicking" _
& vbCrLf & "the Ribbon SampleButton!")
End If
End Sub
ASKER
Hi
Thanks for your information. I have already seen this site. I have copied the code but it is not recognised in the visual Basic editor. Do you know if I have to have a certain reference set for IRibbonUI to be recognised?
thanks so far
Thanks for your information. I have already seen this site. I have copied the code but it is not recognised in the visual Basic editor. Do you know if I have to have a certain reference set for IRibbonUI to be recognised?
thanks so far
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found the answer
http://www.accessribbon.de/en/?Access_-_Ribbons:Callbacks
There is a utilty there (Ribbon creator) that is an EXCELLENT investment, but if you're just looking for answers there is a ton of info there as well.