NigelShaw
Registered User.
- Local time
- Today, 19:49
- Joined
- Jan 11, 2008
- Messages
- 1,575
Hi,
I am having issues with ribbon!!
here is what i have-
To set up the ribbon
My AutoExec opens the form frmTest, here is the onLoad code-
The MainMenu routine called shows the groups that are set to visible = true
This controls the visibility state
This is my XML
the error i get is
Any ideas as there is very little ribbon and code and i can't see why i would get the error. The error message is
Cheers
Nigel
I am having issues with ribbon!!
here is what i have-
To set up the ribbon
Code:
Option Compare Database
Option Explicit
Public bolGrpInfo As Boolean
Public bolGrpContact As Boolean
Public bolGrpPriceList As Boolean
Public glngItemCount As Long
Public bolContactList As Variant
Public gobjRibbon As IRibbonUI
'Public strMenuID As String 'Updateable on every menu change
Public Sub OnRibbonLoad(ribbon As IRibbonUI)
'Callbackname im XML File "onLoad"
Set gobjRibbon = ribbon
bolGrpInfo = True
bolGrpContact = True
bolGrpPriceList = True
End Sub
My AutoExec opens the form frmTest, here is the onLoad code-
Code:
Private Sub Form_Load()
MainMenu
End Sub
Code:
Public Sub MainMenu()
bolGrpInfo = True
bolGrpContact = True
bolGrpPriceList = True
Call RibbonInvalidate
End Sub
Public Sub RibbonInvalidate()
gobjRibbon.InvalidateControl "grpContacts"
gobjRibbon.InvalidateControl "grpPriceList"
gobjRibbon.InvalidateControl "grpInfo"
Code:
Public Sub GetVisible(control As IRibbonControl, ByRef visible)
Select Case control.ID
Case "grpInfo"
visible = bolGrpInfo
Case "grpContacts"
visible = bolGrpContact
Case "grpPriceList"
visible = bolGrpPriceList
Case Else
visible = True
End Select
End Sub
Code:
Sub OnActionButton(control As IRibbonControl)
MsgBox "Place for Action"
End Sub
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="tab0" label="Home" getVisible ="GetVisible">
<group id="grpInfo" label="User" getVisible ="GetVisible">
<labelControl id="lblToday" label="lblToday" getVisible="GetVisible" />
<labelControl id="lblLoggedIn" label="lblLoggedIn" getVisible="GetVisible" />
</group>
<group id="grpContacts" label="Contacts" getVisible ="GetVisible">
<button id="btnNewContact" size="large" label="New Contact" imageMso="DistributionListAddNewMember" onAction="OnActionButton" getVisible="GetVisible" />
<button id="btnEditContact" size="large" label="Edit Contact" imageMso="DirectRepliesTo" onAction="OnActionButton" getVisible="GetVisible" />
</group>
<group id="grpPriceList" label="Price List" getVisible ="GetVisible">
</group>
</tab>
</tabs>
</ribbon>
</customUI>
the error i get is
Any ideas as there is very little ribbon and code and i can't see why i would get the error. The error message is
Cheers
Nigel