slides=prs1.slides
for slide in prs1.slides:
ImageData.insert(1, "Slide "+str(slides.index(slide)+1))
TextData.insert(1, "Slide "+str(slides.index(slide)+1))
for shape in slide.shapes:
if 'Picture' in shape.name:
write_image(shape, ImageData)
elif shape.has_table:
table_data(shape, TextData)
elif shape.has_text_frame:
s=""
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
s+= " "+run.text
TextData.append(s)
elif shape.shape_type == MSO_SHAPE_TYPE.GROUP:
group_data(shape, ImageData, TextData)
def group_data(group_shape, ImageData, TextData):
#for group_shape in group_shapes:
for shape in group_shape.shapes:
if 'Picture' in shape.name:
if (ImageData == []):
ImageData.append("Slide "+str(slides.index(slide)+1))
write_image(shape, ImageData)
elif shape.has_table:
TextData.append("Slide "+str(slides.index(slide)+1))
table_data(shape, TextData)
elif shape.has_text_frame:
if (TextData == []):
TextData.append("Slide "+str(slides.index(slide)+1))
s=""
for paragraph in shape.text_frame.paragraphs:
for run in paragraph.runs:
s+= " "+run.text
TextData.append(s)
elif shape.shape_type == MSO_SHAPE_TYPE.GROUP:
group_data(shape, ImageData, TextData)
I'm not able to read SmartArt data from slides. This is the above code through which i'm able to get 80% of pptx file data. I want to fetch 100% data and store it in a csv file. Even i want to save ppt file as pptx file using python code.