为Access2007创建一个应用程序级的自定义Ribbon——Office2007 用户界面(UI)
2008-10-03 00:00:00 来源:WEB开发网核心提示: “<tabs>” & vbCrLf & _ “<tab id=”"DemoTab”" label=”"LoadCustomUI Demo”">&r
“ <tabs>” & vbCrLf & _
“ <tab id=”"DemoTab”" label=”"LoadCustomUI Demo”">” & _
vbCrLf & _
“ <group id=”"loadFormsGroup”" label=”"Load Forms”">” & _
vbCrLf & _
“{0}” & vbCrLf & _
“ </group>” & vbCrLf & _
“ </tab>” & vbCrLf & _
“ </tabs>” & vbCrLf & _
“ </ribbon>” & vbCrLf & _
“</customUI>”
Dim template As String
template = “<button id=”"load{0}Button”" ” & _
“label=”"Load {0}”" onAction=”"HandleOnAction”" ” & _
“tag=”"{0}”"/>” & vbCrLf
Dim formContent As String
Dim frm As AccessObject
For Each frm In CurrentProject.AllForms
formContent = formContent & _
Replace(template, “{0}”, frm.Name)
Next frm
xml = Replace(xml, “{0}”, formContent)
Debug.Print xml
On Error Resume Next
‘ 如果从AutoExec宏中调用这段代码,
‘ 如果在USysRibbons表中有一个使用相同名称的定制
更多精彩
赞助商链接