I need to get all text that is italic and bold in paragraphs. I am manually turning text into italic and bold form but the code below returns none. Is it only an initiator or can we get the value out of it as well, how can I get all italic and bold text?
def get_italic_ratio(slide):
count = 0
for shape in slide.shapes:
if not shape.has_text_frame:
continue
text_frame = shape.text_frame
par = text_frame.paragraphs[0]
run = par.add_run()
print(run.font.italic) # returns None, should return True
print(run.font.bold) # returns None, should return True
print(text_frame.paragraphs)