private void mailRecipientToolStripMenuItem_Click(object sender, EventArgs e) { // find filename string tempFileName = WorkBookUtils.GetTempFileName(Path.GetFileName(fileName), tempFilesDir, FileExt); // save file if (_Save(tempFileName)) { // load mail client MAPI mapi = new MAPI(); mapi.AddAttachment(tempFileName); mapi.SendMailPopup(string.Format("{0}: {1}", WbLocale.Emailing, Path.GetFileNameWithoutExtension(fileName)), ""); } }
private void mailRecipientasPDFToolStripMenuItem_Click(object sender, EventArgs e) { // find filename string tempFileName = WorkBookUtils.GetTempFileName(Path.GetFileName(fileName), tempFilesDir, ".pdf"); try { WorkBookUtils.RenderPdf(engines, tempFileName); // load mail client MAPI mapi = new MAPI(); mapi.AddAttachment(tempFileName); mapi.SendMailPopup(string.Format("{0}: {1}", WbLocale.Emailing, Path.GetFileNameWithoutExtension(fileName)), ""); } catch (Exception e2) { MessageBox.Show(e2.Message, WbLocale.ErrorMailingPDF, MessageBoxButtons.OK, MessageBoxIcon.Error); } }