Set Margins of Comment or Shape inside the Worksheet

Possible Usage Scenarios

Aspose.Cells for Python via .NET allows you to set the margins of any shape or comment using the Shape.text_body.text_alignment property. This property returns the object of ShapeTextAlignment class which has different properties e.g. top_margin_ptleft_margin_pt, bottom_margin_pt, right_margin_pt, etc. that can be used to set the top, left, bottom and right margins.

Set Margins of Comment or Shape inside the Worksheet

Please see the following sample code. It loads the sample Excel file that contains two shapes. The code accesses the shapes one by one and sets their top, left, bottom and right margins. Please see the output Excel file generated by the code and screenshot showing the effect of the code on the output Excel file.

todo:image_alt_text

Sample Code