我已經爲選定的附件創建了一個Outlook插件來獲取附件的詳細信息。並在Outlook 2010中正常工作。 但是,當我爲Outlook 2016構建它時,它將變爲空。Outlook 2016插件附件選擇問題
下面是ThisAddIn.cs代碼: -
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
System.Reflection.Assembly assemblyInfo = System.Reflection.Assembly.GetExecutingAssembly();
Uri uriCodeBase = new Uri(assemblyInfo.CodeBase);
string Location = Path.GetDirectoryName(uriCodeBase.LocalPath.ToString());
var path = Location.Split(new string[] { "bin" }, StringSplitOptions.RemoveEmptyEntries);
var rootDir = path[0].ToString();
var forPermissionsRootDirectory = Path.GetDirectoryName(rootDir);
SetPermissions(forPermissionsRootDirectory);
app = this.Application;
app.AttachmentContextMenuDisplay += new Outlook.ApplicationEvents_11_AttachmentContextMenuDisplayEventHandler(app_AttachmentContextMenuDisplay);//attach Attachment context Menu Event//
}
void app_AttachmentContextMenuDisplay(Office.CommandBar CommandBar, Outlook.AttachmentSelection selection)
{
selectedAttachment = selection;
RibbonUI.InvalidateControlMso("ContextMenuAttachments");//will get XML file data//
}
,這是AttachmentContextMenu.cs代碼: -
public void OnOpenMyMotionCalendarButtonClick(Office.IRibbonControl control)
{
Outlook.AttachmentSelection selection = ThisAddIn.selectedAttachment;
if ((selection.Count > 0))
{
//My further working
}
}
在選材上,總有空的Outlook 2016 。 請建議做什麼?
此致 沙龍
你有解決這個問題嗎? – Pooran
你找出原因了嗎?這解決了嗎? – Stavm