• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 269
  • Last Modified:

C# and Outlook how - do I return the name and path of an Outlook Attachment

I use the Outlook MailItem to retrieve the values of the Email message.

How do I return the oEmail.Attachment - name and path ? Not sure how to cast it... thanks

                                    
                                                Outlook.MailItem oEmail = mail.LastSentItem();

                                                object[] rowVals = new object[11];
                                                DataRowCollection rc =  this.dsNotes.Tables["Interactions"].Rows;
                                    
                                                rowVals[2] = oEmail.SentOn;
                                                rowVals[3] = String.Concat("Sent:", oEmail.SentOn," Received: ",oEmail.ReceivedTime.ToShortDateString(),System.Environment.NewLine,oEmail.Subject);
                                                rowVals[4] = String.Concat("E-Mail:",System.Environment.NewLine,oEmail.Body);
                                                rowVals[8] = "Sent E-Mail";
                                                rowVals[9] =  oEmail.Attachments  ?????????????????????
                                                rowVals[10]= "E-Mail Message";
0
JElster
Asked:
JElster
  • 2
1 Solution
 
AgariciCommented:
once the file is attached to the mail, it looses the path - it becames part of the mail. in other words a copy of the original file is stored in mime format into the mail but any information about that file is lost - so you can not obtain the attached files path
0
 
JElsterAuthor Commented:
What about the file name ? Thanks
0
 
JElsterAuthor Commented:
What other info can I 'read'?
Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now