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
J GoDaddy migrated to Office365 - Outlook Wont Add Account Exchange Server Administration 9
K Outlook 365 After migrating to Outlook 365, some contacts display in emails with prefixes Using Outlook 0
J Outlook Rules VBA Run a Script - Multiple Rules Outlook VBA and Custom Forms 0
Horsepower Cannot delete gmail in iPhone Outlook outbox Using Outlook 1
F Outlook 2019 Outlook 2019 Add and Sync to New computer Comcast server Using Outlook 2
M Understanding Outlook Identities Using Outlook 1
kburrows Outlook or Phone Combining Contacts? Using Outlook 0
P Outlook 2013 search no longer works Using Outlook 1
M Accessing ALL Outlook contact fields Outlook VBA and Custom Forms 3
C Outlook (desktop app for Microsoft365) restarts every time I save my VBA? Using Outlook 0
R MailTips and older Outlook versions Using Outlook 0
A iCloud Outlook Add In is causing Outlook 2021 to crash and got disabled Using Outlook 4
C How to import Outlook calendar? Using Outlook 0

Similar threads

Top