TextBoxOptions class

TextBoxOptions class

Represents the text options of the shape

The TextBoxOptions type exposes the following members:

Properties

PropertyDescription
shape_text_vertical_alignmentIt corresponds to “Format Shape - Text Options - Text Box - Vertical Alignment” in Excel.
resize_to_fit_textIndicates whether to resize the shape to fit the text
shape_text_directionGets or sets the text display direction within a given text body.
It corresponds to “Format Shape - Text Options - Text Box - Text direction” in Excel
left_margin_ptGets and sets the left margin in unit of Points.
right_margin_ptGets and sets the right margin in unit of Points.
top_margin_ptGets and sets the top margin in unit of Points.
bottom_margin_ptReturns the bottom margin in unit of Points
allow_text_to_overflowWhether allow text to overflow shape.
wrap_text_in_shapeSpecifies text wrapping within a shape.
False - No wrapping will occur on text body.
True - Wrapping will occur on text body.

Example

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
index = workbook.worksheets[0].text_boxes.add(0, 0, 350, 350)
shape = workbook.worksheets[0].text_boxes[index]
shape.text = "This is test."
# do your business
# Save the excel file.
workbook.save("exmaple.xlsx")

See Also