I'm trying to call fit_text() on a textbox, but I keep getting this error:
'NoneType' object is not iterable
from this line
python3.6/site-packages/pptx/text/layout.py in _wrap_lines, line 112
which is
text, remainder = self._break_line(line_source, point_size)
This is my code which produces the error. I have no idea what's wrong here, neither line_source
nor point_size
are None.
def replace_text_of_shape(shape, data):
if shape.has_text_frame:
# replace_text_with(shape.text_frame.paragraphs, data)
shape.text_frame.fit_text(font_family='Calibri', max_size=18, bold=False, italic=False)