私の知る限り、 InlineShapes
コレクションには、裸の Select()
メソッドがありません。したがって、私はあなたがコレクションにlinqを使用しようとしていると仮定しています。
InlineShapes
is an implementation of IEnumerable
which does not have a Select(...)
method.
私はあなたがこれを行う必要があると思う、
// Note the select is spurious here
oDoc.InlineShapes.OfType().Select((shape) => shape)
OfType()
returns an IEnumerable
which does support the Select(...)
method.
IEnumerable
を Select(...)
で拡張した場合、使用する Object
型には有用なプロパティはありません。
編集
InlineShapesから画像を取得したい場合は...
var pictures = oDoc.InlineShapes.OfType().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.
}
これは、ドキュメント内に絵を持つすべてのインラインシェイプのセットを与えるはずです。