-
Notifications
You must be signed in to change notification settings - Fork 666
Closed
Description
Hello, I'm creating a textbox and I want it to be sized so it fits the whole text in the TextFrame. I'm doing the following code:
textbox = slide.shapes.add_textbox(0, 0, Inches(3), Inches(1))
text_frame = textbox.text_frame
text_frame.text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
text_frame.auto_size = MSO_AUTO_SIZE.SHAPE_TO_FIT_TEXT
text_frame.word_wrap = True
This is what I get:
If i go to the Textbox properties I have the following:
If I click again on the Resize shape to fit text then I get the correct behavior:
FYI: I don't have PowerPoint, I'm using WPS, could that contribute to the problem?
Metadata
Metadata
Assignees
Labels
No labels


