Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save documentprocessing/d103ec68dc7c3ca93a65de438d3562e1 to your computer and use it in GitHub Desktop.
Save documentprocessing/d103ec68dc7c3ca93a65de438d3562e1 to your computer and use it in GitHub Desktop.
Add Bullets to PowerPoint PPTX
from pptx import Presentation
prs = Presentation()
slide_with_bullet_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(slide_with_bullet_layout)
shapes = slide.shapes
title_shape = shapes.title
body_shape = shapes.placeholders[1]
title_shape.text = 'Adding a Bullet Slide'
text_frame = body_shape.text_frame
text_frame.text = 'Find the bullet slide layout'
paragraph = text_frame.add_paragraph()
paragraph.text = 'Use _TextFrame.text for first bullet'
paragraph.level = 1
paragraph = text_frame.add_paragraph()
paragraph.text = 'Use _TextFrame.add_paragraph() for subsequent bullets'
paragraph.level = 2
prs.save('BulletSlideExample.pptx')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment