VSTOのCommandBarButton位置
-
21-08-2019 - |
質問
私は、VSTOアドイン展望2003のすべての新MailItemsための標準ツールバー
ボタンを追加するために書いています私はそれがほとんど完成持っているが、私は、タスクバー上のボタンの位置を設定する方法を動作するように見ることができない - 。理想的に私は右隣送信]ボタンにそれを配置したいと思います。
ここでのコードは、私がこれまで持っています。
Private Sub colInsp_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles colInsp.NewInspector
Dim msg As Outlook.MailItem
Dim commandBar As Office.CommandBar
Dim encryptButton As Office.CommandBarButton
Dim olkitem As Object
olkitem = Me.ActiveInspector().CurrentItem
If TypeOf Inspector.CurrentItem Is Outlook.MailItem Then
msg = CType(Inspector.CurrentItem, Outlook.MailItem)
commandBar = Inspector.CommandBars("Standard")
encryptButton = commandBar.FindControl(Tag:="EncryptMail")
If Not (encryptButton Is Nothing) Then
encryptButton.Delete()
End If
encryptButton = CType(commandBar.Controls.Add(1), Office.CommandBarButton)
encryptButton.Style = Office.MsoButtonStyle.msoButtonIconAndCaption
encryptButton.FaceId = 718
encryptButton.Caption = "Secure Email"
encryptButton.Tag = "EncryptMail"
If olkitem.Sensitivity = Outlook.OlSensitivity.olConfidential Then
encryptButton.State = Office.MsoButtonState.msoButtonDown
End If
AddHandler encryptButton.Click, AddressOf encryptButton_Click
msg = Nothing
End If
End Sub
すべてのヘルプは途方もいただければ幸いです!
おかげで、 ジムます。
解決
私が代わりにcommandBar.AddControl(control, position)
の構文を使用している必要があります。
他のヒント
Outlook 2007でます:
(Office.CommandBarButton)commandBars["Standard"].Controls.Add(Office.MsoControlType.msoControlButton, System.Reflection.Missing.Value, System.Reflection.Missing.Value,2,true);
2
は位置の数である。
所属していません StackOverflow