.NETを使用してOutlook用アプリケーションレベルアドインを作成するのは初めてです。チュートリアルを使用してコードを書き留めましたが、正常にビルドされましたが、コードをデバッグできませんでした。Outlook用アプリケーションレベルアドインをデバッグできない
必要なバージョンのMicrosoftアプリケーションがインストールされていないため、このプロジェクトを実行またはデバッグすることはできません。
私はのVisual StudioとMS Office 2007の 2010を使用しています。コードをデバッグするにはどうすればいいですか?コードを変更してデバッグできるかここ
はコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Interop.Outlook;
namespace OutlookAddIn1
{
public partial class ThisAddIn
{
Outlook.Inspectors inspectors;
event InspectorsEvents_NewInspectorEventHandler NewInspector;
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
inspectors = this.Application.Inspectors;
inspectors.NewInspector +=
new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
void Inspectors_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector)
{
Outlook.MailItem mailItem = Inspector.CurrentItem as Outlook.MailItem;
if (mailItem != null)
{
if (mailItem.EntryID == null)
{
mailItem.Subject = "This text was added by using code";
mailItem.Body = "This text was added by using code";
}
}
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
#endregion
}
}
MS Office 2016の場合、バージョン番号は「16.0」です。 –