Following sample opens an email dialog with a specified document already attached
private void butEMailFiles_Click(object sender, RoutedEventArgs e) { string archiveName = GetExistingArchiveName(); if (File.Exists(archiveName)) { RunShellCommand("Outlook.exe", "/a \"" + archiveName + "\""); } } private static void RunShellCommand(string app, string args) { string dir = System.IO.Path.GetDirectoryName(app); string file = System.IO.Path.GetFileName(app); Process process = new Process(); process.StartInfo.FileName = file; process.StartInfo.WorkingDirectory = dir; process.StartInfo.Arguments = args; process.Start(); }
No comments:
Post a Comment