Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Struct

PowerPointTextStyle

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
0eef6a5756b9 with working tree changes
Base
ValueType
Modifiers
sealed

Defines text formatting that can be applied to runs or paragraphs.

Inheritance

  • ValueType
  • PowerPointTextStyle

Usage

Explore 16 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 2

Constructors

public PowerPointTextStyle(OfficeLength? fontSize = null, string? fontFamily = null, OfficeColor? color = null, bool? bold = null, bool? italic = null, bool? underline = null, OfficeColor? backgroundColor = null, bool? strikethrough = null) #

Creates a new text style instance.

Parameters

fontSize OfficeIMO.OfficeLength? = null optional
fontFamily string? = null optional
color OfficeIMO.OfficeColor? = null optional
bold bool? = null optional
italic bool? = null optional
underline bool? = null optional
backgroundColor OfficeIMO.OfficeColor? = null optional
strikethrough bool? = null optional

Methods

Apply 2 overloads
public void Apply(PowerPointTextRun run) #

Applies the style to a text run.

Parameters

run OfficeIMO.PowerPoint.PowerPointTextRun required
public void Apply(PowerPointParagraph paragraph) #

Applies the style to a paragraph's default run.

Parameters

paragraph OfficeIMO.PowerPoint.PowerPointParagraph required
public PowerPointTextStyle WithBackgroundColor(OfficeColor? backgroundColor) #

Returns a copy with a new run background (highlight) color.

Parameters

backgroundColor OfficeIMO.OfficeColor? required
public PowerPointTextStyle WithBold(bool? bold) #

Returns a copy with bold formatting updated.

Parameters

bold bool? required
public PowerPointTextStyle WithColor(OfficeColor? color) #

Returns a copy with a new color.

Parameters

color OfficeIMO.OfficeColor? required
public PowerPointTextStyle WithFontFamily(string? fontFamily) #

Returns a copy with a new font family.

Parameters

fontFamily string? required
public PowerPointTextStyle WithFontSize(OfficeLength? fontSize) #

Returns a copy with a new font size.

Parameters

fontSize OfficeIMO.OfficeLength? required
public PowerPointTextStyle WithItalic(bool? italic) #

Returns a copy with italic formatting updated.

Parameters

italic bool? required
public PowerPointTextStyle WithStrikethrough(bool? strikethrough) #

Returns a copy with strikethrough formatting updated.

Parameters

strikethrough bool? required
public PowerPointTextStyle WithUnderline(bool? underline) #

Returns a copy with underline formatting updated.

Parameters

underline bool? required
public PowerPointTextStyle WithUnderlineStyle(PowerPointUnderlineStyle? underlineStyle) #

Returns a copy with a native underline variant; null clears the underline override.

Parameters

underlineStyle OfficeIMO.PowerPoint.PowerPointUnderlineStyle? required

Properties

public OfficeLength? FontSize { get; } #

Physical font size, stored in DrawingML hundredths of a point.

public string? FontFamily { get; } #

Font family (Latin).

public OfficeColor? Color { get; } #

Text color; alpha below 255 is written as native DrawingML opacity.

public bool? Bold { get; } #

Bold formatting.

public bool? Italic { get; } #

Italic formatting.

public bool? Underline { get; } #

Underline formatting.

public PowerPointUnderlineStyle? UnderlineStyle { get; } #

Precise native underline variant; null leaves the variant unspecified.

public bool? Strikethrough { get; } #

Strikethrough formatting.

public OfficeColor? BackgroundColor { get; } #

Run background (DrawingML highlight) color; alpha below 255 is written as native opacity.

public static PowerPointTextStyle Title { get; } #

A preset for typical slide titles.

public static PowerPointTextStyle Subtitle { get; } #

A preset for subtitles.

public static PowerPointTextStyle Body { get; } #

A preset for body text.

public static PowerPointTextStyle Caption { get; } #

A preset for captions or footnotes.

public static PowerPointTextStyle Emphasis { get; } #

A preset that enables bold emphasis.