Sie sind hier: Startseite > Access - Ribbons > Ribbon XML / Controls > Vorhandene Access Ribbons manipulieren
Vorhandene Access Ribbons manipulieren
Sie haben auch die Möglichkeit Access Ribbon Funktionen zu überlagern. Dazu gibt es im Ribbon XML die Sektion <commands>
Im folgenden Beispiel wurden die Access Funktionen "Ausschneiden" und "Kopieren" ersetzt.
Die dazugehörige XML Ribbon Datei:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<commands>
<commands idMso="Cut" onAction="CallbackCut"/>
<commands idMso="Copy" onAction="CallbackCopy"/>
</commands>
</customUI>
Wie Sie an die idMso der Access-Controls kommen wird hier beschrieben.
Beim Klicken auf einen der Buttons wird nun der entsprechende Callback ausgeführt.
Auch über ExcecuteMso wird der entsprechende Callback ausgeführt.
Application.CommandBars.ExecuteMso("Copy")
Inhalt des Modules "basCallbacks":
Option Compare Database
Option Explicit
Sub CallbackCut(control As IRibbonControl, _
ByRef bolCancel As Boolean)
MsgBox "Ausschneiden"
bolCancel = True
End Sub
Sub CallbackCopy(control As IRibbonControl, _
ByRef bolCancel As Boolean)
MsgBox "Kopieren"
bolCancel = True
End Sub
Sie finden dieses Beispiel auch in der Beispieldatenbank 1

