如何开发 outlook 插件?

How to develop a outlook add-in?

我希望创建适用于 Outlook 2010 和 Office 365 的 outlook 加载项。

我想要它做的是将一封 MSG 格式的电子邮件保存到我指定的网络文件夹中,然后将该电子邮件移动到 outlook 中的存档文件夹中。

我对编程了解不多(只是基础知识)。我希望有人能为我指出正确的方向,告诉我如何开始这个项目,以及我可以使用哪些资源来做这个。

非常感谢任何帮助。

谢谢

使用 VSTO 创建 COM 插件。从 https://msdn.microsoft.com/en-us/library/ms268878.aspx

开始

请参阅 Walkthrough: Creating Your First VSTO Add-In for Outlook 了解入门信息。

What I want it to do is Save an email in MSG format to a folder on our network, that I specify, and then move that email to an archive folder within outlook.

要将电子邮件保存到文件夹,您需要使用 MailItem class 的 SaveAs 方法,该方法将 Microsoft Outlook 项目保存到指定路径并以指定文件类型的格式保存.如果未指定文件类型,则使用 MSG 格式 (.msg)。例如:

Sub SaveAsTXT() 
 Dim myItem As Outlook.Inspector 
 Dim objItem As Object 

 Set myItem = Application.ActiveInspector 
 If Not TypeName(myItem) = "Nothing" Then 
   Set objItem = myItem.CurrentItem 
   strname = objItem.Subject 
   'Prompt the user for confirmation 
   Dim strPrompt As String 
   strPrompt = "Are you sure you want to save the item? " &; _ 
   "If a file with the same name already exists, " &; _ 
   "it will be overwritten with this copy of the file." 
   If MsgBox(strPrompt, vbYesNo + vbQuestion) = vbYes Then 
     objItem.SaveAs Environ("HOMEPATH") &; "\My Documents\" &; strname &; ".txt", olTXT 
   End If 
 Else 
   MsgBox "There is no current active inspector." 
 End If 
End Sub

要将 Outlook 项目移动到另一个文件夹,您需要使用 Move 方法将 Microsoft Outlook 项目移动到新文件夹。

最后,您可能会发现 Selecting an API or technology for developing solutions for Outlook 文章很有帮助。它解释了扩展 Outlook 的可能选项。