私はOutlookのメールにMSのチャートを取得しようとしています。デスクトップに保存するのを避けたいので、MemoryStream
を使用することに決めました。これは私がこれまでにまとめたものです:メモリストリームを使用してWinFormsアプリケーションからOutlook電子メールにMSチャートを挿入するにはどうすればよいですか?
MemoryStream s = new MemoryStream();
chart1.SaveImage(s, ChartImageFormat.Png);
s.Position = 0;
OutlookApp outlookApp = new OutlookApp();
MailItem mailItem = outlookApp.CreateItem(OlItemType.olMailItem);
mailItem.Subject = "This is the subject";
chart1.SaveImage(s, ChartImageFormat.Png);
chart1.SaveImage(s, ChartImageFormat.Png);
mailItem.HTMLBody = "<html><body>This is the <strong>funky</strong> message body</body></html>" ;
mailItem.Attachments.Add(s);
//Set a high priority to the message
mailItem.Importance = OlImportance.olImportanceHigh;
mailItem.To = "[email protected]";
mailItem.Display(false);
//mailItem.Send();
私はちょうど電子メールへMemoryStream
を取得する方法を見つけるように見えることはできません。
本当にわかりません、 Outlookオブジェクトモデルはメモリから添付ファイルを追加することをサポートしていないようです。 [this](https://msdn.microsoft.com/en-us/library/office/ff869553.aspx)を参照してください。私は[Outlook Redemption](http://www.dimastr.com/redemption/home.htm)をご覧になることをお勧めします。 –
埋め込みOLEオブジェクト(チャート)または埋め込み画像を含むHTMLメールを使用してRTFメールを作成しようとしていますか? –