Reputation: 1
I've created an VSTO-Add-In for Outlook, which imports several data from an pdf-file and saves the data as an MS-Excel-File. After successfully process i start a Toastnotification ,which enables an fast opening of this Excel-file by clicking on the notification in the info-center. The problem: clicking on the notification of other incoming e-mails (Outlook) doesn't work anymore. Nothing happens. How can i solve this problem?
public Ribbon1()
{
Initialize();
}
private async Task Initialize()
{
await Task.Run(() =>
{
ToastNotificationManagerCompat.OnActivated += async toastArgs =>
{
ToastArguments args = ToastArguments.Parse(toastArgs.Argument);
await Task.Run(() =>
{
if (!string.IsNullOrEmpty(toastArgs.Argument) && !toastArgs.Argument.Contains("idEPST=ignore") && toastArgs.Argument.Contains("idEPST="))
{
string datei = toastArgs.Argument.ToLower().Replace("idEPST=", String.Empty).Trim().Replace(".xls", "");
ProcessStartInfo si = new ProcessStartInfo();
si.FileName = "excel.exe";
si.Arguments = $"\"C:\\folder\\file.xls\" /{datei}";
Process.Start(si);
}
});
};
});
}
}
//and later
new ToastContentBuilder()
.AddAudio(null, silent: true)
.AddArgument("idEPST", filename)
.AddHeader("identifier", "My Excel App Name", String.Empty)
.AddText($"{name}, {firstname}", hintMaxLines: 1)
.AddText("... sucessfully saved.")
.Show();
After deinstalling the VSTO-Add-In: On clicking on a e-mail-notification results in an error message: "Cannot Start Microsoft Outlook. The Command Line Argument Is Not Valid..."
Upvotes: 0
Views: 234
Reputation: 49455
It seems there are some problems with windows registry keys, especially with .msg file associations. Because when you click on a toast notification in Outlook a corresponding item is displayed/opened.
Re-associate the .msg file by following the steps and verify the results.
See Error: The command line argument is not valid. Verify the switch you are using. for more information.
Upvotes: 0