ExcelScript.ShapeAutoSize enum

許可される自動サイズ変更を決定します。

注釈

/**
 * This script creates a star shape with the value from cell A1.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the value of A1 from the worksheet named Sheet1.
  const sheet = workbook.getWorksheet("Sheet1");
  const value = sheet.getRange("A1").getValue();

  // Create a Shape object that looks like a 5-pointed star.
  const star = sheet.addGeometricShape(ExcelScript.GeometricShapeType.star5);

  // Set the text of star and make sure the shape fits the text.
  const textFrame = star.getTextFrame();
  textFrame.getTextRange().setText(value.toString());
  textFrame.setAutoSizeSetting(ExcelScript.ShapeAutoSize.autoSizeShapeToFitText);
}

フィールド

autoSizeMixed

自動サイズ変更の組み合わせが使用されます。

autoSizeNone

自動サイズ変更は実行されません。

autoSizeShapeToFitText

図形はテキストに合わせて調整されます。

autoSizeTextToFitShape

テキストは図形に合わせて調整されます。