ExcelScript.Image interface

Stellt ein Bild im Arbeitsblatt dar. Verwenden Sie Image.getShape, um das entsprechende Shape -Objekt abzurufen.

Hinweise

Beispiele

/**
 * 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");
}

Methoden

getFormat()

Gibt das Format des Bilds zurück.

getId()

Gibt den Shape-Bezeichner für das Bildobjekt an.

getShape()

Gibt das Shape dem Bild zugeordnete Objekt zurück.

Details zur Methode

getFormat()

Gibt das Format des Bilds zurück.

getFormat(): PictureFormat;

Gibt zurück

getId()

Gibt den Shape-Bezeichner für das Bildobjekt an.

getId(): string;

Gibt zurück

string

getShape()

Gibt das Shape dem Bild zugeordnete Objekt zurück.

getShape(): Shape;

Gibt zurück