0
我一直教程添加加載項色帶到Outlook以下。在我的項目中,我有MyRibbon.vb和MyRibbon.xml。我編輯了MyRibbon.xml,因此有一個按鈕顯示「綠色打印」。在MyRibbon.vb我增加了一些代碼,我希望會顯示一條消息,說「Hello World」的按鈕被按下時使一個附加的功能區按鈕做一些事情
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="MyGroup"
label="My Group">
<button id="printButton" label="Green Print" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
:
#Region "Ribbon Callbacks"
'Create callback methods here. For more information about adding callback methods, visit https://go.microsoft.com/fwlink/?LinkID=271226
Public Sub Ribbon_Load(ByVal ribbonUI As Office.IRibbonUI)
Me.ribbon = ribbonUI
End Sub
Public Sub OnActionCallback(ByVal control As Office.IRibbonControl,
ByVal isPressed As Boolean)
If (control.Id = "printButton") Then
MsgBox("Hello World!")
End If
End Sub
#End Region
然而,當我點擊綠色打印加載項功能區中的按鈕沒有任何反應 - 沒有任何錯誤信息或任何內容。請問我哪裏錯了?
嗨 - 感謝。我還發現,我不得不刪除行: BYVAL isPressed由於布爾 –