Hi @asad.ali ,
I have a sceanrio where my .xlsx excel sheet is having .msg as a atttachment, But the Issue is my code does not extract the child attachment. On contrary if i have .eml file with .xlsx attachment in it , it is extracted success fully.
Can you share me the Code snippet of how to Extract xlsx file child Object ??
Currently i have below Code snippet which does not execute switch statement coz it comes out since This condition becomes true.
!oleObject.DisplayAsIcon
also note when i try to see Extension valeu of (oleObject.FileFormatType) it shows Ole10Native instead of msg .
public override List GetDirectChilds()
{
using (var workbook = LoadWorkbook())
{
var childs = new List();
foreach (var worksheet in workbook.Worksheets)
foreach (var oleObject in worksheet.OleObjects)
{
if (oleObject.IsLink || !oleObject.DisplayAsIcon)
{
continue;
}
string extension;
switch (oleObject.FileFormatType)
{
case FileFormatType.MsEquation:
continue;
case FileFormatType.MapiMessage:
extension = ".msg";
break;
case FileFormatType.Unknown:
extension = Path.GetExtension(oleObject.ObjectSourceFullName);
break;
default:
extension = string.Format(".{0}", oleObject.FileFormatType.ToString().ToLower());
if (!IsSupported(extension))
{
throw new BadRequestException($"No converter found for file extension: {extension}");
}
break;
}
childs.Add(new DirectChild(extension, true, new MemoryStream(oleObject.ObjectData),
originalFileName: oleObject.ObjectSourceFullName));
}
return childs;
}
}\\\Kindly do not ask me to share the Whole code snippet as here i am not asking you for any fix and i am just asking to Provide me solution so that i can get msg extracted from the xlsx file .
Kindly you provide me the Code snippet where it will show Correctly that this extension is of type msg and not ole10native type