Powerpoint has the following text options for shapes:
I am able to control the vertical alignment and margins via the following code:
## Define a text frame for a previously created rectangular shape
txt_frame = rec.text_frame
## Set the options for the text frame
txt_frame.vertical_anchor = MSO_VERTICAL_ANCHOR.TOP
txt_frame.margin_top = Cm(0.39)
txt_frame.margin_bottom = Cm(0.25)
txt_frame.margin_left = Cm(2.72)
txt_frame.margin_right = Cm(0.25)
How do I ensure Resize shape to fit text is set to True
?
I am using python-pptx == 0.6.23