Microsoft PowerPoint provides a wide variety of themes that you can use in your PowerPoint presentations. These themes improve the look and feel of the presentations and make them perfect for modern and sophisticated pitches. You can also apply themes to PowerPoint files dynamically within your C++ applications. To that end, this article will teach you how to apply themes in PowerPoint presentations programmatically using C++.

C++ API for Applying Theme in PowerPoint PPT

Aspose.Slides for C++ is a C++ API for working with PowerPoint files. It enables you to create, read and update PPT and PPTX files without needing additional software. Furthermore, the API allows you to apply themes to PowerPoint presentations. You can either install the API through NuGet or download it directly from the Downloads section.

PM> Install-Package Aspose.Slides.Cpp

Apply Theme to PowerPoint Presentations in C++

A PowerPoint theme is a set of colors, font family, font size, background style, etc., that can be applied to different elements. In the following sections, we will explore how to set the theme color, font, and background style in PowePoint presentations.

Apply PowerPoint Theme in C++ - Set Theme Color

The following are the steps to set the theme color for a shape in a PowerPoint PPT in C++.

The following sample code shows how to set the theme color for a shape in a PowerPoint presentation in C++.

Set Theme Font in PowerPoint Presentation using C++

Similar to Microsoft PowerPoint, Aspose.Slides for C++ provides the following identifiers to set the font from the font scheme.

  • +mn-lt”: Body Font Latin (Minor Latin Font)
  • +mj-lt”: Heading Font Latin (Major Latin Font)
  • +mn-ea”: Body Font East Asian (Minor East Asian Font)
  • +mj-ea”: Body Font East Asian (Minor East Asian Font)

The following are the steps to create a text element and assign the Latin font to it.

The following sample code shows how to set the theme font in a PPT presentation in C++.

Change PowerPoint Theme Background Style in C++

The following are the steps to set the theme background style in a PowerPoint presentation.

The following sample code demonstrates how to set the theme background style in a PowerPoint presentation using C++.

Work with PowerPoint PPT Themes - Get a Free License

You can manipulate PowerPoint themes without evaluation limitations by getting a free temporary license.

Conclusion

In this article, you have learned how to apply themes in PowerPoint presentations in C++. Specifically, you have learned how to set the theme color, font, and background style of PowerPoint PPT. Aspose.Slides for C++ is a robust API that provides many additional features for working with PPTX/PPT files. You can explore the API in detail by visiting the official documentation. In case of any queries, please feel free to reach us at our free support forum.

See Also