We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to view attachment without saving the it

Hi Aspose


i would like to know how can we view the attachment without saving it on our harddrive just like outlook for example when you open an outlook and go to a message and if that message has an attachment you the user have the option to open or save the attachment, what i want in my application is to open the attachment without saving it. With the combination of aspose.email and aspose.cell.griddesktop.

here is my situation: lets say i have an msg file and that msg file i have xls attached, what i want is to be able to open the xls file or display the xls file in the grid of aspose.cell.griddesktop using code.

attached is an image from outlook.
thanks…

Hi,


Thank you for you inquiry.

I am afraid that there are no means to open an email attachment without saving it to the disk. I have researched a little to open the attachment stream in its native program by using the System. Diagnostics.Process class. I haven’t succeeded so far, but if I do I’ll let you know here.

For your reference, Aspose.Email.Mail.Attachment.ContentStream can return you the data in the form of System.IO.Stream. You can further use this data in your custom code to get the XLS file for your requirement.

Thanks and Regards,

how about displaying the stream in the GridDesktop1 control is it posible?

Hi,


I have almost no experience with Aspose.Cells GridDesktop control. I think, the experts from Aspose.Cells forum will answer this question more appropriately.

I am going to move this thread to Aspose.Cells forum for further assistance.

Hi,

Yes, you can load Excel file into Aspose.Cells for GridDesktop using the GridDesktop.ImportExcelFile() method.

This method has two overloads, you can either assign the file path or file stream.

Below is a sample code that uses file path, you can modify it for your needs.

C#


string filePath = @“F:\Shak-Data-RW\Downloads\Copy+of+PLOT+combinato+aTB+startracker+cold.xlsx”;

gridDesktop1.ImportExcelFile(filePath);