I am writing code to extract the cells and pictures/images in cells from an Excel doc into a database.
With this code I can get the cell values that are not Pictures.
However, the Cell object doesn't have a picture it in. Note that every row starts with an image.
A1- Picture
B1- Text
C1- Text and so on.
How do I get the image from the "A" column?
WorkbookPart wbPart = document.WorkbookPart;
var workSheet = wbPart.WorksheetParts.FirstOrDefault();
foreach (Row r in workSheet.Worksheet.Descendants<Row>())
{
//Note only has Colum B,C. Not A as A has an image???
foreach(Cell c in r.ChildElements)
{
foreach(object o in c.ChildElements)
{
Console.WriteLine(c.CellReference + " " + o.ToString());
}
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…