Aim: I want to get image from inside of table cell in word document using OpenXML with C#. But I dont know which method to use for it.
string questionText = cells[1].InnrerText
var questionImage = cells[1]. // <<------ What method to try here?
The general approach for questions like this is to:
w:tc
, w:p
, w:drawing
, a:graphic
, a:blip
) you want to create, read, update, or delete;TableCell
(for w:tc
), Paragraph
(for w:p
), Drawing
(for w:drawing
), Graphic
(for a:graphic
), and Blip
(for a:blip
); anduse the desired class name, eg, as follows:
var blip = cells[1].Descendants<Blip>().FirstOrDefault();
The above example assumes you want the Blip
to identify the ImagePart
that contains the image data.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.