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

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.
Similar threads
Thread starter Title Forum Replies Date
R PST->Outlook.com (Import vs Drag-n-Drop methods Using Outlook.com accounts in Outlook 2
J Can Click to Drag Custom Form Field But Cannot Drop When Designing in Outlook 2007 Outlook VBA and Custom Forms 2
K Cannot consistently drag and drop .msg files into Outlook 2010 Using Outlook 0
F Tumblr - Drag & Drop files (pictures) into Outlook? Using Outlook 12
V Drag and drop into Outlook folders Using Outlook 2
R Outlook 2007 - drag drop email to Explorer Using Outlook 1
J Problem using drag and drop to attach an html email in Outlook 2010 Using Outlook 18
N Drag and drop attachment in outlook addin Outlook VBA and Custom Forms 4
A Implementing Drag and drop events in outlook Outlook VBA and Custom Forms 7
P Drag and Drop mails from Outlook to Clarion6 Application Outlook VBA and Custom Forms 5
M Extract "Date sent" from emails (saved to folder using drag and drop) Outlook VBA and Custom Forms 1
C Cannot drag and drop or create folder in PST file folders Using Outlook 1
L Copying Emails using drag and drop Using Outlook 2
T drag drop/opening drop down/single click acts like double/highlighting Using Outlook 7
M Drag and drop Outlook VBA and Custom Forms 1
S Drag-and-drop to Custom Task Pane Outlook VBA and Custom Forms 2
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S Renaming while drag and dropping to file Using Outlook 1
B Right click-drag no longer creates hyperlinks Using Outlook 2
T Can not drag e-mails from search to folders Using Outlook 1
S cannot drag emails to personal folders BCM (Business Contact Manager) 1
J How to create a drop down user defined field that will appear on an inbox view Outlook VBA and Custom Forms 8
D Outlook 2013 Macros only run in VB editor, not in drop down or button Outlook VBA and Custom Forms 14
Z See "Change View" Drop Down as a List? Using Outlook 1
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
D BCM 2013 not functioning as BCM 2010 Example no drop down for communications history Using Outlook 0
M Same file "stuck" on top of file list in "Attach File" drop down Using Outlook 4
A Automatically send email based on drop-down field? Outlook VBA and Custom Forms 2
Diane Poremsky No drop down calendars in Outlook 2010 Print Options Using Outlook 0
P BCM 2013 Contacts Form Drop Down Box Bug BCM (Business Contact Manager) 1
P Field in Forms displayed depending on the Item chosen from drop-down-list BCM (Business Contact Manager) 1
M Add custom locations to Outlook Forms "Look In:" drop-down list Using Outlook 5
M How do I link a drop down box to a percent complete box Using Outlook 4
R Display multiple accounts as drop down in the from field in New Mail Using Outlook 1
S Outlook addin formregion as a drop down Outlook VBA and Custom Forms 6
S RE: Template with drop down Outlook VBA and Custom Forms 3
C Drop Down Box in Email Template Outlook VBA and Custom Forms 2
W Outlook 2016 MSI - Possible to make work with O365 modern Auth & Win7? Using Outlook 4
T Outlook roaming signatures Using Outlook 4
S Adding a recipient's column to Sent folder in Outlook 2010 Outlook VBA and Custom Forms 1
J Outlook search bar in Office 2021 Professional Using Outlook 0
J PSA: How to create custom keyboard shortcut for "Paste Unformatted Text" in Outlook on Windows Outlook VBA and Custom Forms 1
C How to fix outlook continuing to prompt fo an Exchange password Using Outlook 0
C Outlook doesn't feel reliable, anymore Using Outlook 5
J Outlook 2016 Trying to get Outlook 2016 to work with Office 365 Using Outlook 0
C Outlook 365 Copy/Save Emails in Folder Outside Outlook to Show Date Sender Recipient Subject in Header Using Outlook 0
U Outlook not responding when trying to print Emails Using Outlook 5
O How to sync (one way) contacts between two Outlook (exchange) accounts? Using Outlook 0
S Sync Outlook (2021) tasks with Microsoft To Do Using Outlook 1
L Duplicate calendar entries in Outlook 365 Using Outlook 4

Similar threads

Top