Ich habe ein Outlook-Add-in für ausgewählten Anhang erstellt, um Details des Anhangs zu erhalten. und es funktioniert gut in Outlook 2010. Aber wenn ich es für Outlook 2016 erstellen, dann wird es null.Outlook 2016 Plugin AttachmentSelection Problem
Sie den Code unten in ThisAddIn.cs ist: -
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//
}
und dies ist der Code in AttachmentContextMenu.cs: -
public void OnOpenMyMotionCalendarButtonClick(Office.IRibbonControl control)
{
Outlook.AttachmentSelection selection = ThisAddIn.selectedAttachment;
if ((selection.Count > 0))
{
//My further working
}
}
Bei der Auswahl gibt es für Outlook 2016 immer null Bitte schlagen Sie vor, was zu tun ist?
Mit freundlichen Grüßen, Ariel
Haben Sie eine Lösung dafür gefunden? – Pooran
Haben Sie die Ursache herausgefunden? war das gelöst? – Stavm