尝试在部署解决方案时在“主页”选项卡中显示自定义组Outlook VSTO加载项

时间:2017-06-07 17:57:53

标签: visual-studio-2015 vsto outlook-addin

我正在编写VSTO Outlook加载项,在我正在开发的机器中,我可以添加custom ribbon group to the home tab但是当我通过VS安装程序the home tab group does not show部署加载项时。我已将 controlID设置为TabMail ,我检查了之前的答案无效。使用Visual Studio 2015和Outlook 2013。

以下是此功能区的自动生成的设计器类定义:

Partial Class Ribbon3
Inherits Microsoft.Office.Tools.Ribbon.RibbonBase

<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New(ByVal container As System.ComponentModel.IContainer)
    MyClass.New()
    InitializeComponent()
    'Required for Windows.Forms Class Composition Designer support
    If (container IsNot Nothing) Then
        container.Add(Me)
    End If

End Sub

<System.Diagnostics.DebuggerNonUserCode()> _
Public Sub New()
    MyBase.New(Globals.Factory.GetRibbonFactory())

    'This call is required by the Component Designer.
    InitializeComponent()

End Sub

'Component overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
    Try
        If disposing AndAlso components IsNot Nothing Then
            components.Dispose()
        End If
    Finally
        MyBase.Dispose(disposing)
    End Try
End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Component Designer
'It can be modified using the Component Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
    Dim RibbonDialogLauncherImpl1 As Microsoft.Office.Tools.Ribbon.RibbonDialogLauncher = Me.Factory.CreateRibbonDialogLauncher
    Me.Tab1 = Me.Factory.CreateRibbonTab
    Me.EIP = Me.Factory.CreateRibbonGroup
    Me.Button1 = Me.Factory.CreateRibbonButton
    Me.Button3 = Me.Factory.CreateRibbonButton
    Me.Button2 = Me.Factory.CreateRibbonButton
    Me.Label1 = Me.Factory.CreateRibbonLabel
    Me.EditBox1 = Me.Factory.CreateRibbonEditBox
    Me.Button4 = Me.Factory.CreateRibbonButton
    Me.Tab1.SuspendLayout()
    Me.EIP.SuspendLayout()
    Me.SuspendLayout()
    '
    'Tab1
    '
    Me.Tab1.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office
    Me.Tab1.ControlId.OfficeId = "TabMail"
    Me.Tab1.Groups.Add(Me.EIP)
    Me.Tab1.Label = "TabMail"
    Me.Tab1.Name = "Tab1"
    '
    'EIP
    '
    Me.EIP.DialogLauncher = RibbonDialogLauncherImpl1
    Me.EIP.Items.Add(Me.Button1)
    Me.EIP.Items.Add(Me.Button3)
    Me.EIP.Items.Add(Me.Button2)
    Me.EIP.Items.Add(Me.Label1)
    Me.EIP.Items.Add(Me.EditBox1)
    Me.EIP.Items.Add(Me.Button4)
    Me.EIP.KeyTip = "O"
    Me.EIP.Label = "EIP"
    Me.EIP.Name = "EIP"
    Me.EIP.Position = Me.Factory.RibbonPosition.AfterOfficeId("Find")
    '
    'Button1
    '
    Me.Button1.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge
    Me.Button1.Label = "Archive to EIP"
    Me.Button1.Name = "Button1"
    Me.Button1.OfficeImageId = "FileOpenRecentFile"
    Me.Button1.ShowImage = True
    '
    'Button3
    '
    Me.Button3.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge
    Me.Button3.Label = "Update EIP List"
    Me.Button3.Name = "Button3"
    Me.Button3.OfficeImageId = "ChangeFolderDownloadSettings"
    Me.Button3.ScreenTip = "Rebuild the internal list matching EIP numbers to EIP directories"
    Me.Button3.ShowImage = True
    '
    'Button2
    '
    Me.Button2.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge
    Me.Button2.Label = "Open EIP Folder"
    Me.Button2.Name = "Button2"
    Me.Button2.OfficeImageId = "AlwaysMoveToFolder"
    Me.Button2.ShowImage = True
    '
    'Label1
    '
    Me.Label1.Label = "Active EIP"
    Me.Label1.Name = "Label1"
    '
    'EditBox1
    '
    Me.EditBox1.Label = "Active EIP"
    Me.EditBox1.Name = "EditBox1"
    Me.EditBox1.ScreenTip = "EIP number to associate with message if none found"
    Me.EditBox1.ShowLabel = False
    Me.EditBox1.Text = Nothing
    '
    'Button4
    '
    Me.Button4.Label = "Clear"
    Me.Button4.Name = "Button4"
    Me.Button4.OfficeImageId = "Clear"
    Me.Button4.ShowImage = True
    '
    'Ribbon3
    '
    Me.Name = "Ribbon3"
    Me.RibbonType = "Microsoft.Outlook.Explorer"
    Me.Tabs.Add(Me.Tab1)
    Me.Tab1.ResumeLayout(False)
    Me.Tab1.PerformLayout()
    Me.EIP.ResumeLayout(False)
    Me.EIP.PerformLayout()
    Me.ResumeLayout(False)

End Sub
Friend WithEvents EIP As Microsoft.Office.Tools.Ribbon.RibbonGroup
Friend WithEvents Button1 As Microsoft.Office.Tools.Ribbon.RibbonButton
Friend WithEvents Button3 As Microsoft.Office.Tools.Ribbon.RibbonButton
Friend WithEvents Tab1 As Microsoft.Office.Tools.Ribbon.RibbonTab
Friend WithEvents Button2 As Microsoft.Office.Tools.Ribbon.RibbonButton
Friend WithEvents EditBox1 As Microsoft.Office.Tools.Ribbon.RibbonEditBox
Friend WithEvents Label1 As Microsoft.Office.Tools.Ribbon.RibbonLabel
Friend WithEvents Button4 As Microsoft.Office.Tools.Ribbon.RibbonButton
End Class

1 个答案:

答案 0 :(得分:1)

如果主机上未安装任何其使用的控件,则功能区组将不会显示。我必须将vsto运行时设置为先决条件,然后一切运行良好。 Select the installer project,然后在属性窗口中选择先决条件后select the vsto runtime as a prerequisite