private void Form1_DragDrop(object sender, DragEventArgs e) { //wrap standard IDataObject in OutlookDataObject OutlookDataObject dataObject = new OutlookDataObject(e.Data); outlookmessage.GetFileFromDrag(dataObject); }
// Get the names and data streams of the files dropped and send to CopyFiles public void GetFileFromDrag(OutlookDataObject dataObject) { string[] filenames = (string[])dataObject.GetData("FileGroupDescriptorW"); MemoryStream[] filestreams = (MemoryStream[])dataObject.GetData("FileContents"); CopyFiles(filenames, filestreams); }