|
@@ -295,7 +295,14 @@ namespace InABox.DynamicGrid
|
|
Task.Run(() =>
|
|
Task.Run(() =>
|
|
{
|
|
{
|
|
var tempfile = Path.Combine(System.IO.Path.GetTempPath(), SanitiseFileName(file.Key));
|
|
var tempfile = Path.Combine(System.IO.Path.GetTempPath(), SanitiseFileName(file.Key));
|
|
- File.WriteAllBytes(tempfile, file.Value);
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ File.WriteAllBytes(tempfile, file.Value);
|
|
|
|
+ }
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ // Outlook likes to keep files open apparently, which breaks this code.
|
|
|
|
+ }
|
|
var info = new System.Diagnostics.ProcessStartInfo(tempfile);
|
|
var info = new System.Diagnostics.ProcessStartInfo(tempfile);
|
|
info.UseShellExecute = true;
|
|
info.UseShellExecute = true;
|
|
info.Verb = "Open";
|
|
info.Verb = "Open";
|