How to Create Numbered or Bulleted Lists in PowerPoint [Python Tips]

How to Create Numbered or Bulleted Lists in PowerPoint [Python Tips]

·

6 min read

Creating lists is essential in PowerPoint presentations, whether for analytical reports, annual summaries, or product introductions. Lists present related information in a clear, visually appealing way compared to paragraphs. While manual creation works, why not speed things up with Python? Using Python PowerPoint automation, you can quickly generate numbered or bulleted lists, saving time and minimizing errors from manual input. In this guide, we’ll show you how to create numbered or bulleted lists in PowerPoint slides, helping you create polished, professional PowerPoint presentations effortlessly.


Python Library to Create Lists in PowerPoint Presentations

Although Python is capable of handling many tasks on its own, leveraging third-party libraries can save significant time and effort. When it comes to working with PowerPoint files in Python, popular libraries include Aspose.Slides for Python via .NET, Spire.Presentation for Python, and python-pptx. Among these, Spire.Presentation (short for Spire.Presentation for Python) stands out for its user-friendly APIs, regular updates, and responsive technical support.

In this guide, we'll demonstrate how to create numbered and bulleted lists in PowerPoint presentations using Spire.Presentation. Don’t worry if you prefer a different library—the steps are generally similar across tools.

To get started, install Spire.Presentation using the following pip command: pip install Spire.Presentation.

How to Create Numbered Lists in PowerPoint Using Python

Once the preparation is complete, let’s start with the most common type of list: numbered lists. These are ideal for presenting structured content in a clear and organized manner. Numbered lists work particularly well for sequential or step-by-step information, such as instructions, processes, or prioritized items. Below, we’ll explore how to use Python to create a numbered list in a PowerPoint presentation effortlessly.

Steps to create numbered lists in a PowerPoint slide:

  • Create an object of the Presentation class, and get a slide using the Presentation.Slides[] property.

  • Add a shape to the slide with the ISlide.Shapes.AppendShape() method, and configure the shape style.

  • Specify the details of a numbered list in a list.

  • Create paragraphs based on these details and set the bullet type of these paragraphs to Numbered using the ParagraphProperties.BulletType property.

  • Customize the numbered bullet style of these paragraphs through the ParagraphProperties.BulletStyle property.

  • Add the paragraphs to the shape with the IAutoShape.TextFrame.Paragraphs.Append() method.

  • Save the updated PowerPoint presentation through the Presentation.SaveToFile() method.

Here is an example of creating a numbered list on the first page of a PowerPoint presentation:

from spire.presentation.common import *
from spire.presentation import *

# Create an object of the Presentation class
presentation = Presentation()

# Get the first slide
slide = presentation.Slides[0]

# Add a shape to the slide and set the shape style
shape = slide.Shapes.AppendShape(ShapeType.Rectangle, RectangleF(50.0, 50.0, 300.0, 200.0))
shape.Fill.FillType = FillFormatType.none
shape.Line.FillType= FillFormatType.none

# Add text to the default paragraph
paragraph = shape.TextFrame.Paragraphs[0]
paragraph.Text = "Required Web Development Skills:"
paragraph.Alignment = TextAlignmentType.Left
paragraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
paragraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()

# Specify the list items
listItems = [
    " Command-line Unix",
    " Vim",
    " HTML",
    " CSS",
    " Python",
    " JavaScript",
    " SQL"
]

# Create a numbered list
for item in listItems:
    textParagraph = TextParagraph()
    textParagraph.Text = item
    textParagraph.Alignment = TextAlignmentType.Left
    textParagraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
    textParagraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()

    textParagraph.BulletType = TextBulletType.Numbered
    textParagraph.BulletStyle = NumberedBulletStyle.BulletArabicPeriod
    shape.TextFrame.Paragraphs.Append(textParagraph)

# Save the result document
presentation.SaveToFile("/NumberedList.pptx", FileFormat.Pptx2013)
presentation.Dispose()

Python Create Numbered Bulleted List in PowerPoint

Create a Symbol Bulleted List in PowerPoint Presentations with Python

Another commonly used list type is the symbol bulleted list, which is versatile for both formal reports and informal presentations. Symbol bulleted lists are especially effective for presenting information in a clear, concise format without implying any particular order. Creating this kind of list follows a similar process to numbered lists, with the main difference being the use of the ParagraphProperties.BulletType property to set the list type to Symbol. Let’s dive into the specific steps.

Steps to create symbol bulleted lists in PowerPoint presentations:

  • Create an instance of the Presentation class and get a slide with the Presentation.Slides[] property.

  • Add a shape to the slide using the ISlide.Shapes.AppendShape() method, and set the shape style.

  • Specify the list items in a list.

  • Create paragraphs based on the list items and set the bullet type of these paragraphs to Symbol with the ParagraphProperties.BulletType property.

  • Add the paragraphs to the shape using the IAutoShape.TextFrame.Paragraphs.Append() method.

  • Save the updated PowerPoint presentation.

Below is the code example of creating a symbol bulleted list on the first slide of a PowerPoint document:

from spire.presentation.common import *
from spire.presentation import *

# Create an object of the Presentation class
presentation = Presentation()

# Get the first slide
slide = presentation.Slides[0]

# Add a shape to the slide and set the shape style
shape = slide.Shapes.AppendShape(ShapeType.Rectangle, RectangleF(50.0, 50.0, 350.0, 200.0))
shape.Fill.FillType = FillFormatType.none
shape.Line.FillType = FillFormatType.none

# Add text to the default paragraph
paragraph = shape.TextFrame.Paragraphs[0]
paragraph.Text = "Computer Science Subjects:"
paragraph.Alignment = TextAlignmentType.Left
paragraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
paragraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()

# Specify the list items
listItems = [
    " Data Structure",
    " Algorithm",
    " Computer Networks",
    " Operating System",
    " Theory of Computations",
    " C Programming",
    " Computer Organization and Architecture"
]

# Create a symbol bulleted list
for item in listItems:
    textParagraph = TextParagraph()
    textParagraph.Text = item
    textParagraph.Alignment = TextAlignmentType.Left
    textParagraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
    textParagraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()
    textParagraph.BulletType = TextBulletType.Symbol
    shape.TextFrame.Paragraphs.Append(textParagraph)

# Save the result document
presentation.SaveToFile("/SymbolBulletedList.pptx", FileFormat.Pptx2013)
presentation.Dispose()

Python Create Symbol Bulleted List in PowerPoint

How to Create Image Bulleted Lists in PowerPoint with Python

Image bulleted lists are ideal for content that emphasizes branding, themes, or a unique design aesthetic, making them perfect for marketing presentations, creative showcases, and similar use cases. To add such a list to a PowerPoint presentation, you can leverage the ParagraphProperties.BulletType and ParagraphProperties.BulletPicture.EmbedImage properties. Here’s how you can use these properties effectively.

Steps to create image bulleted lists on a PowerPoint slide:

  • Create a Presentation object, and retrieve a slide using the Presentation.Slides[] property.

  • Add a shape to the slide through the ISlide.Shapes.AppendShape() method, and customize the shape style.

  • Specify details of the image bulleted list in a list.

  • Create paragraphs based on these list details, and configure the bullet type of these paragraphs to Picture using ParagraphProperties.BulletType property.

  • Use an image as the bullet point through the ParagraphProperties.BulletPicture.EmbedImage property.

  • Add paragraphs to the shape using IAutoShape.TextFrame.Paragraphs.Append() method.

  • Save the resulting file.

Here is an example of creating an image bulleted list on the first slide of a PowerPoint presentation:

from spire.presentation.common import *
from spire.presentation import *

# Create an object of the Presentation class
presentation = Presentation()

# Get the first slide
slide = presentation.Slides[0]

# Add a shape to the slide and set the shape style
shape = slide.Shapes.AppendShape(ShapeType.Rectangle, RectangleF(50.0, 50.0, 400.0, 180.0))
shape.Fill.FillType = FillFormatType.none
shape.Line.FillType = FillFormatType.none

# Add text to the default paragraph
paragraph = shape.TextFrame.Paragraphs[0]
paragraph.Text = "Project Task To-Do List:"
paragraph.Alignment = TextAlignmentType.Left
paragraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
paragraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()

# Specify the list items
listItems = [
    " Define projects and tasks you're working on",
    " Assign people to tasks",
    " Define the priority levels of your tasks",
    " Keep track of the progress status of your tasks",
    " Mark tasks as done when completed"
]

# Create an image bulleted list
for item in listItems:
    textParagraph = TextParagraph()
    textParagraph.Text = item
    textParagraph.Alignment = TextAlignmentType.Left
    textParagraph.TextRanges[0].Fill.FillType = FillFormatType.Solid
    textParagraph.TextRanges[0].Fill.SolidColor.Color = Color.get_Black()
    textParagraph.BulletType = TextBulletType.Picture  
    stream = Stream("/Lock_icon.png")
    imageData = presentation.Images.AppendStream(stream)
    textParagraph.BulletPicture.EmbedImage = imageData
    shape.TextFrame.Paragraphs.Append(textParagraph)
    stream.Close()

# Save the result document
presentation.SaveToFile("/ImageBulletedList.pptx", FileFormat.Pptx2013)
presentation.Dispose()

Python Create Image Bulleted List in PowerPoint

To Wrap Up

This page provides a detailed guide on creating numbered and bulleted lists in PowerPoint presentations, with step-by-step instructions and code examples. After reading through the blog, you’ll see how Python can help you accomplish this task quickly and efficiently.