As far as I can tell the InlineShapes
collection does not have a naked Select()
method. Therefore I am assuming that you are trying to use linq on the collection.
InlineShapes
is an implementation of IEnumerable
which does not have a Select(...)
method.
I suspect that you need to do this,
// Note the select is spurious here
oDoc.InlineShapes.OfType<InlineShape>().Select((shape) => shape)
OfType<T>()
returns an IEnumerable<T>
which does support the Select(...)
method.
Consider that if IEnumerable
was extended by Select(...)
there wouldn't be any useful properties on the Object
type for you to use.
EDIT
If you want to get the images from the InlineShapes you could...
var pictures = oDoc.InlineShapes.OfType<InlineShape>().Where(s =>
s.Type = WdInlineShapeType.wdInlineShapePicture ||
s.Type = WdInlineShapeType.wdInlineShapeLinkedPicture ||
s.Type = WdInlineShapeType.wdInlineShapePictureHorizontalLine ||
s.Type = WdInlineShapeType.wdInlineShapeLinkedPictureHorizontalLine);
foreach(var picture in pictures)
{
picture.Select();
oWord.Selection.Copy()
//Then you need to retrieve the contents of the clipboard
//which I feel is another question.
}
That should give you a set of all the inline shapes in the document that have a picture.