diff --git a/PROMS/Sync/Sync/frmSync.cs b/PROMS/Sync/Sync/frmSync.cs index 3db06c37..7fb6a049 100644 --- a/PROMS/Sync/Sync/frmSync.cs +++ b/PROMS/Sync/Sync/frmSync.cs @@ -222,12 +222,20 @@ namespace Sync } BuildZipOfMailBox(tbMailBox.Text); } + private string _RTFFile = null; + public string RTFFile + { + get { return _RTFFile; } + set { _RTFFile = value; } + } private void BuildZipOfMailBox(string mailbox) { SevenZipCompressor.SetLibraryPath(Application.StartupPath + @"\7z.dll"); SevenZipCompressor cmpr = new SevenZipCompressor(); cmpr.PreserveDirectoryRoot = true; - string zipName = string.Format("{0} To SS {1}.7z", mailbox, DateTime.Now.ToString("yyyyMMdd HHmm")); + string fileDate = DateTime.Now.ToString("yyyyMMdd HHmm"); + RTFFile = string.Format("{0} To SS {1}.Rtf", mailbox, fileDate); + string zipName = string.Format("{0} To SS {1}.7z", mailbox, fileDate); cmpr.CompressDirectory(mailbox, zipName, "*.*", true); MessageBox.Show(string.Format("{0} created!", zipName), "Mailbox Zip Created", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -500,7 +508,13 @@ namespace Sync dao.SetData(DataFormats.Text,sb.ToString()); dao.SetData(DataFormats.Rtf, rtb.Rtf); Clipboard.SetDataObject(dao, true, 10, 500); - MessageBox.Show(sb.ToString(), "Copied to Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Information); + if (RTFFile != null) + { + rtb.SaveFile(RTFFile); + System.Diagnostics.Process.Start(RTFFile); + } + else + MessageBox.Show(sb.ToString(), "Copied to Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) {