Drag and Drop Outlook mails into a Windows Form Control with eml extension

H

hemaneelagiri

Hi
i want to drag and drop mails from outlook to my application. i am able to
drag and srop but those file s are saving as .msg . but i want it into eml
and after that it should be like ordinary file

i am droping like this

string[] filenames = (string[])dataObject.GetData
("FileGroupDescriptor");
MemoryStream[] filestreams = (MemoryStream[])dataObject.
GetData("FileContents");
string strPath = GetTempPath() + @"OutLookFiles";
try
{
if (!Directory.Exists(strPath))
{
DirectoryInfo di = Directory.CreateDirectory(strPath)
;
di = null;
}

}
catch (Exception ex)
{
throw ex;
}
finally
{

}
bool bAutoSaved = false;

for (int fileIndex = 0; fileIndex < filenames.Length;
fileIndex++)
{
//use the fileindex to get the name and data stream
string filename = filenames[fileIndex];
MemoryStream filestream = filestreams[fileIndex];

//save the file stream using its name to the application
path

FileStream outputStream = File.Create(strPath + @"/" +
filename);
filestream.WriteTo(outputStream);
outputStream.Close();
filestream.Close();

//FileInfo tempFile = new FileInfo(Common.
GetMosaiqueTempPath() + filename);
importFiles(strPath + @"/" + filename, ref bAutoSaved,
bCreateShortcut);
//File.Delete(Common.GetMosaiqueTempPath() + filename);
}

but this file is saving in .msg file.

and when i am droping mail into my application if that mail has any
appointments. that appointment should be added like another file.
please help me
 
R

rino

Hi hemaneelagiri

I have a question about the dataObject.

How doo you create the dataObject object?

rino
 
Top