2009-05-12 3 views
0

내가 쓰고 있어요 VSTO 나는 그것이 대부분 완성있어 아웃룩 2003VSTO CommandBarButton에 위치

에 모든 새로운 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 

도움이 될 것입니다!

감사합니다. Jim.

답변

1

나는 Outlook 2007에서 commandBar.AddControl(control, position) 구문을 대신

-1

을 사용 했어야 : 2는 위치의 수는

(Office.CommandBarButton)commandBars["Standard"].Controls.Add(Office.MsoControlType.msoControlButton, System.Reflection.Missing.Value, System.Reflection.Missing.Value,2,true); 

.

+0

안녕하세요. 게시물 형식을 올바르게 지정하려면 게시물을 편집하십시오 (게시물 편집기에 통합 도움말이 있음). – Xan