ExcelScript.Image interface

ワークシート内のイメージを表します。 対応する Shape オブジェクトを取得するには、 を使用 Image.getShapeします。

注釈

/**
 * This script transfers an image from one worksheet to another.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the worksheet with the image on it.
  const firstWorksheet = workbook.getWorksheet("FirstSheet");

  // Get the first image from the worksheet.
  // If a script added the image, you could add a name to make it easier to find.
  let image: ExcelScript.Image;
  firstWorksheet.getShapes().forEach((shape, index) => {
    if (shape.getType() === ExcelScript.ShapeType.image) {
      image = shape.getImage();
      return;
    }
  });

  // Copy the image to another worksheet.
  image.getShape().copyTo("SecondSheet");
}

メソッド

getFormat()

画像の形式を返します。

getId()

イメージ オブジェクトの図形識別子を指定します。

getShape()

イメージに Shape 関連付けられているオブジェクトを返します。

メソッドの詳細

getFormat()

画像の形式を返します。

getFormat(): PictureFormat;

戻り値

getId()

イメージ オブジェクトの図形識別子を指定します。

getId(): string;

戻り値

string

getShape()

イメージに Shape 関連付けられているオブジェクトを返します。

getShape(): Shape;

戻り値