Back to Devexpress

Presentation.DefaultTextStyle Property

officefileapi-devexpress-dot-docs-dot-presentation-dot-presentation-c4f57125.md

latest2.6 KB
Original Source

Presentation.DefaultTextStyle Property

Gets or sets the default text style for the presentation.

Namespace : DevExpress.Docs.Presentation

Assembly : DevExpress.Docs.Presentation.v25.2.dll

NuGet Package : DevExpress.Docs.Presentation

Declaration

csharp
public TextStyle DefaultTextStyle { get; set; }
vb
Public Property DefaultTextStyle As TextStyle

Property Value

TypeDescription
TextStyle

Contains text style settings.

|

Remarks

The Presentation.DefaultTextStyle is applied to all text elements in the presentation unless you specify a different style for certain text elements.

The following code snippet specifies the default text style properties for Level 1 texts:

csharp
using DevExpress.Docs.Presentation;

namespace PresentationApiSample;

public class Program {
    public static void Main(string[] _) {

        // Load a presentation from a file
        Presentation presentation = new Presentation(File.ReadAllBytes(@"..\..\..\data\my-presentation.pptx"));

        // Set the paragraph text style properties for texts of Level 1
        presentation.DefaultTextStyle.Level1ParagraphProperties.TextProperties.Bold = true;
        presentation.DefaultTextStyle.Level1ParagraphProperties.TextProperties.Italic = true;
    }
}
vb
Imports DevExpress.Docs.Presentation

Namespace PresentationApiSample

    Public Class Program
        Public Shared Sub Main(__ As String())

            ' Load a presentation from a file
            Dim presentation As Presentation = New Presentation(File.ReadAllBytes("..\..\..\data\my-presentation.pptx"))

            ' Set the paragraph text style properties for texts of Level 1
            presentation.DefaultTextStyle.Level1ParagraphProperties.TextProperties.Bold = True
            presentation.DefaultTextStyle.Level1ParagraphProperties.TextProperties.Italic = True

        End Sub
    End Class
End Namespace

See Also

Presentation Class

Presentation Members

DevExpress.Docs.Presentation Namespace