2010/06/02

access2010 CustomUI xml読み込んでからのRibbon設定

'Form:F01
Option Compare Database
Option Explicit

Private Sub Form_Load()
    rbn01.CreateRibbon
    Me.RibbonName = rbn01.rbnName
End Sub
'標準Module:rbn01
Option Compare Database
Option Explicit

Private rbn As IRibbonUI

Public Const rbnName = "rbnName"
Private Const xmlFilePath = "xmlFileFullPath"

Public Function OnLoad(ribbon As IRibbonUI)
    Set rbn = ribbon
End Function

Public Sub CreateRibbon()
    If Not rbn Is Nothing Then Exit Sub
    Dim xmldoc As Object
    Set xmldoc = CreateObject("MSXML2.DOMDocument")
    xmldoc.Load xmlFilePath
    Application.LoadCustomUI rbnName, xmldoc.xml
    Set xmldoc = Nothing
End Sub

0 件のコメント: