f = file("d:\\1.txt","w") slide_count = pptSel.Slides.Count for i in range(1,slide_count + 1): shape_count = pptSel.Slides(i).Shapes.Count print shape_count for j in range(1,shape_count + 1): if pptSel.Slides(i).Shapes(j).HasTextFrame: s = pptSel.Slides(i).Shapes(j).TextFrame.TextRange.Text f.write(s.encode('utf-8') + "\n") f.close() ppt.Quit()