1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
private Attachment makeScreenshot2()
{
Excel.Range r = Globals.Sheet1.Range["A1", "M50"];
r.CopyPicture(XlPictureAppearance.xlScreen, XlCopyPictureFormat.xlBitmap);
string path = "C:\\fichier.png";
Clipboard.GetImage().Save(path);
var ret = new Attachment(path);
ret.Name = "Planning.png";
ret.ContentDisposition.Inline = true;
ret.ContentDisposition.DispositionType= DispositionTypeNames.Inline;
ret.ContentId = Path.GetFileName(path).Replace(".", "");
ret.ContentType.MediaType = "image/png";
ret.ContentType.Name = Path.GetFileName(path);
return ret;
} |
Partager