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

  • Thread starter hemaneelagiri
  • Start date Views 2,927
Status
Not open for further replies.
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

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

Hi hemaneelagiri

I have a question about the dataObject.

How doo you create the dataObject object?

rino

"hemaneelagiri" wrote:


> 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
> .
>
 
Status
Not open for further replies.
Top