表单区域自定义操作

时间:2015-11-13 18:07:04

标签: vb.net forms outlook vsto outlook-addin

我使用命令按钮将一个表单区域导入到我的项目中。

我为我的formdesigner.vb创建了一个这样的习惯用法

Private Shared Sub InitializeManifest(ByVal manifest As Microsoft.Office.Tools.Outlook.FormRegionManifest, ByVal factory As Microsoft.Office.Tools.Outlook.Factory)
            Dim FormRegionCustomActionImpl1 As Microsoft.Office.Tools.Outlook.FormRegionCustomAction = factory.CreateFormRegionCustomAction
            FormRegionCustomActionImpl1.Body = Microsoft.Office.Tools.Outlook.FormRegionCustomActionBody.Prefix
            FormRegionCustomActionImpl1.Method = Microsoft.Office.Tools.Outlook.FormRegionCustomActionMethod.Send
            FormRegionCustomActionImpl1.Name = "Complete"
            FormRegionCustomActionImpl1.ShowOnRibbon = False
            FormRegionCustomActionImpl1.SubjectPrefix = "Completed: "
            FormRegionCustomActionImpl1.Title = "Complete"
            manifest.CustomActions.Add(FormRegionCustomActionImpl1)
            manifest.FormRegionName = "CallCenterRd"
            manifest.FormRegionType = Microsoft.Office.Tools.Outlook.FormRegionType.Replacement
            manifest.ShowInspectorCompose = False
            manifest.Title = "Test"

        End Sub

单击我的表单区域命令按钮时,如何“运行”此操作?

1 个答案:

答案 0 :(得分:0)

您的自定义操作可以通过名称执行,方法是从MailItem.Actions集合中获取并调用Action.Execute:

https://msdn.microsoft.com/EN-US/library/ff868574.aspx