No problem. I figured out I just needed to uncheck the com add in under the
Access options.
Regarding the custom ribbons per user. I have a file that tells me who has
authoity to the various programs that are displayed via my menu system. I
simply added a field to this file that contains the actual XML needed to
display the ribbon.
Here is sample value in this field for a pgrams call "Call List".
<button id="cmdCallList" label="Call list" imageMso="AutoDial"
onAction="Ribbon.CallList"/>
Here is an example of the ribbon being created:
Dim XMLTasks$
Dim XMLTasks1$
Dim XMLTasks2$
Dim SaveMenu$
Dim XMLForm$
Dim XMLReport$
Set DB = Application.CurrentDb
XMLTasks1 = _
"<customUI xmlns= ""
http://schemas.microsoft.com/office/2006/01/customui"">"
& vbCrLf & _
" <ribbon startFromScratch=""true"">" & vbCrLf & _
" <officeMenu>" & vbCrLf & _
" <button idMso=""FileCompactAndRepairDatabase"" insertBeforeMso
=""FileCloseDatabase"" />" & vbCrLf & _
" <button idMso=""FileOpenDatabase"" visible=""false""/>" & vbCrLf & _
" <button idMso=""FileNewDatabase"" visible=""false""/>" & vbCrLf & _
" <splitButton idMso=""FileSaveAsMenuAccess"" visible=""false"" />" & vbCrLf
& _
" </officeMenu>" & vbCrLf & _
" <tabs>" & vbCrLf & _
" <tab id=""tabMain"" label=""Home"">" & vbCrLf & _
" <group id=""grpTasks"" label=""Tasks"">" & vbCrLf & _
" <button id=""cmdSearch"" label=""Search"" onAction=""Ribbon.LeadInquiry""
size=""large"" imageMso=""FindDialog"" supertip=""Find a lead in the
database.""/>"
' Only load the dashboard if the user has authority
If UserAuthorized(86) = True Then
XMLTasks2 = _
" <button id=""cmdDashsBoard"" label=""Dashboard""
onAction=""Ribbon.DashBoard"" size =""large"" imageMso=""ChartAxes""
supertip=""Display sales dashboard.""/>" & vbCrLf & _
" </group>"
Else
XMLTasks2 = _
" </group>"
End If
XMLTasks = XMLTasks1 & vbCrLf & XMLTasks2
SqlString = "spLoadRibbon " & Forms!frmSession!UserNo
Call CreateStoredProcedure("sptLoadRibbon", SqlString)
Set DB = Application.CurrentDb
Dim RS As dao.Recordset
Set RS = DB.OpenRecordset("sptLoadRibbon", dbOpenDynaset)
RS.MoveFirst
SaveMenu = ""
While Not RS.EOF
If RS!Menu <> SaveMenu Then ' Menu changed
' Write end tags if not the first time the menu changed
If SaveMenu <> "" Then
XMLTasks = XMLTasks & vbCrLf & _
" </menu>" & vbCrLf & _
" </splitButton>" & vbCrLf & _
" </group>"
End If
' Process tags for new menu
SaveMenu = RS!Menu
XMLTasks = XMLTasks & vbCrLf & _
RS!MenuXMLRibbon
End If
' Parse XML program data
XMLTasks = XMLTasks & vbCrLf & _
RS!ProgramXMLRibbon
'End If
RS.MoveNext
Wend
' End of records, add end tags for split menus
XMLTasks = XMLTasks & vbCrLf & _
" </menu>" & vbCrLf & _
" </splitButton>" & vbCrLf & _
" </group>"
RS.Close
Set RS = Nothing
' Add final XML tags
XMLTasks = XMLTasks & vbCrLf & _
" </tab>" & vbCrLf & _
" </tabs>" & vbCrLf & _
" </ribbon>" & vbCrLf & _
" </customUI>"
Application.LoadCustomUI "Home", XMLTasks
This code creates the default "Home" ribbon for each form.
This works great in our shop. Each user has the potential to a view ribbon
that is purely for them.
tighe said:
Richard,
sorry i do not have an answer for you. I was wondering of you could share
how you are "display[ing] what I want based upon user authority."
Richard Kohler said:
I have a dynamic ribbon that works well. It only displays what I want based
upon user authority. When I installed the Access 2007 run time software, I
now have Developer menu items displaying when I click the Office Button. How
I can get rid of it? I can't distribute a run time app with options that are
not needed.
Thanks