Shape
- class Shape(*args, **options)
The shape object is a member of the
shapescollection:>>> # Assumes an existing workbook object named book. >>> sheet = book.sheets[0] >>> sheet.shapes[0] # or sheet.shapes['ShapeName'] <Shape 'Rectangle 1' in Sheet1>
バージョン 0.9.0 で変更.
- property api: Any
Returns the native object (
pywin32orappscriptobj) of the engine being used.Added in version 0.19.2.
- property characters: Characters
Returns the
Charactersobject for the shape text, used to format part of the text.
- property font: Font
Returns the
Fontobject for the shape text, used to read or change font formatting.
- async get_text()
Fetch the shape's text on demand.
Noneif the shape holds no text.Requires xlwings Lite.
- 戻り値の型:
str | None
- property parent: Sheet
Shapeの親オブジェクトを返します。
Added in version 0.9.0.
- scale_height(factor, relative_to_original_size=False, scale='scale_from_top_left')
- パラメータ:
factor (float) -- 例えば、1.5なら150%に拡大します。
relative_to_original_size (bool) --
Falseの場合、現在の高さからの相対的な大きさで拡大縮小します (デフォルト)。Trueは図またはOLE objectでなければなりません。scale (str) --
scale_from_top_left(デフォルト)、scale_from_bottom_right、scale_from_middleのいずれか。
Added in version 0.19.2.
- scale_width(factor, relative_to_original_size=False, scale='scale_from_top_left')
- パラメータ:
factor (float) -- 例えば、1.5なら150%に拡大します。
relative_to_original_size (bool) --
Falseの場合、現在の幅からの相対的な大きさで拡大縮小します (デフォルト)。Trueは図またはOLE objectでなければなりません。scale (str) --
scale_from_top_left(デフォルト)、scale_from_bottom_right、scale_from_middleのいずれか。
Added in version 0.19.2.