从outlook vsto打开一个excel文件与visual studio的插件

从outlook vsto打开一个excel文件与visual studio的插件

问题描述:

你如何打开/使用outlook插件在excel文件上工作?从outlook vsto打开一个excel文件与visual studio的插件

我导入前景命名空间:

Imports Outlook = Microsoft.Office.Interop.Outlook 

但Excel的命名空间是无法访问的

Imports Outlook = Microsoft.Office.Interop.excel 

我只能导入Microsoft.Office.tools.excel,但它不提供我认为的功能...

我自己找到答案:

您需要广告d通过参考的Microsoft.Office.Interop.Excel扩展:

项目>添加引用>扩展>的Microsoft.Office.Interop.Excel

然后,您可以:

Imports Excel = Microsoft.Office.Interop.Excel 


    Public Class ThisAddIn 

     Dim ExcelApp As New Excel.Application 
     Dim ExcelWorkbook As Excel.Workbook 

    end class