This quick example entails how to strike out text in PPTX using C#. It encompasses the information about the required resources, a step-wise procedure, and a working sample code to strike out PPTX text using c#. It shares process details including creating the sample presentation, adding autoshape, creating the text frame by adding the text, and striking the text.
Steps to Strike Out Text in PPTX using C#
- Configure the environment to add Aspose.Slides for .NET to strike out text in PPTX
- Create a default empty presentation using an instance of the Presentation class and access the first slide
- Create an auto shape of the Rectangle type and add a sample text frame inside it
- Add a portion of text inside the text frame and set the Double line strike through using the TextStrikethroughType enumerator
- Add a second portion of text inside the text frame and set the single line strike through using the TextStrikethroughType enumerator
- Save the presentation with strike through text on the PPTX
The aforementioned steps describe how to strike out text in Presentation using C#. All the required classes, methods, and properties are specified and used in a well-defined order to obtain the desired output like Presentation class is used for creating an empty or loading the existing PPTX file, the ShapeCollection class is used for adding the autoshape in the PPTX slide, the TextStrikethroughType enumerator is used to set the required strikethrough type for the selected portion of the text.
Code to Strike Out Text in PPTX using C#
The above example demonstrates strikeout text in PPT using c#. It uses the Presentation class object to create the default empty presentation and uses Presentation.Slides property to access the first default slide from the slides collection. An autoshape of the Rectangle type is created, which is then followed by adding text inside it. Finally, by using the TextStrikethroughType enumerator, the required text striking is set and the presentation with strikeout text is saved on the disk.
This tutorial has guided us to strike out presentation text using C#. If you want to learn the process to merge the slides inside the presentation, refer to the article on how to merge slides in C#.