Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointTextRun

OfficeIMO.PowerPoint

Namespace
OfficeIMO.PowerPoint
Assembly
OfficeIMO.PowerPoint
Source revision
0eef6a5756b9 with working tree changes

Represents a formatted text run within a paragraph.

Inheritance

  • object
  • PowerPointTextRun

Usage

Explore 22 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 4

Methods

public void ClearClickSound() #

Removes the sound played when this text run is clicked.

public void ClearMouseOverSound() #

Removes the sound played when the pointer enters this text run.

public byte[]? GetClickSoundBytes() #

Returns the exact embedded click-sound bytes, when present.

Returns

byte[]?
public byte[]? GetMouseOverSoundBytes() #

Returns the exact embedded mouse-over-sound bytes, when present.

Returns

byte[]?
public PowerPointTextRun SetBackgroundColor(OfficeColor color) #

Sets PowerPointTextRun.BackgroundColor and returns this run.

Parameters

color OfficeIMO.OfficeColor required
public PowerPointTextRun SetBaseline() #

Restores the run to the normal text baseline.

public PowerPointTextRun SetBold(bool isBold = true) #

Sets PowerPointTextRun.Bold and returns this run.

Parameters

isBold bool = true optional
public void SetClickSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #

Sets an embedded WAV or AIFF sound played when this text run is clicked.

Parameters

audio System.IO.Stream required
name string required
contentType string = "audio/wav" optional
extension string = ".wav" optional
public void SetClickStopsSound(bool value) #

Controls whether clicking this text run stops the currently playing sound.

Parameters

value bool required
public PowerPointTextRun SetColor(OfficeColor color) #

Sets PowerPointTextRun.Color and returns this run.

Parameters

color OfficeIMO.OfficeColor required
public PowerPointTextRun SetFontFamily(string fontFamily) #

Sets PowerPointTextRun.FontFamily and returns this run.

Parameters

fontFamily string required
public PowerPointTextRun SetFontSize(OfficeLength size) #

Sets PowerPointTextRun.FontSize and returns this run.

Parameters

size OfficeIMO.OfficeLength required
SetHyperlink 3 overloads
public PowerPointTextRun SetItalic(bool isItalic = true) #

Sets PowerPointTextRun.Italic and returns this run.

Parameters

isItalic bool = true optional
public void SetMouseOverSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #

Sets an embedded WAV or AIFF sound played when the pointer enters this text run.

Parameters

audio System.IO.Stream required
name string required
contentType string = "audio/wav" optional
extension string = ".wav" optional
public void SetMouseOverStopsSound(bool value) #

Controls whether entering this text run stops the currently playing sound.

Parameters

value bool required
public PowerPointTextRun SetStrikethrough(bool strikethrough = true) #

Sets PowerPointTextRun.Strikethrough and returns this run.

Parameters

strikethrough bool = true optional
public PowerPointTextRun SetSubscript(double baselinePercent = 25) #

Applies subscript using a 25 percent baseline shift.

Parameters

baselinePercent double = 25 optional
public PowerPointTextRun SetSuperscript(double baselinePercent = 30) #

Applies superscript using a 30 percent baseline shift.

Parameters

baselinePercent double = 30 optional
public PowerPointTextRun SetUnderline(bool underline = true) #

Sets PowerPointTextRun.Underline and returns this run.

Parameters

underline bool = true optional
public PowerPointTextRun TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #

Changes the stored run text casing while preserving run formatting.

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase required
culture System.Globalization.CultureInfo? = null optional

Properties

public string? Language { get; set; } #

Gets or sets the BCP 47 language tag applied to this text run.

public string? HyperlinkTooltip { get; set; } #

Gets or sets the accessible tooltip associated with this run's click hyperlink.

public bool HasMeaningfulHyperlinkLabel { get; } #

Returns whether the visible link text is meaningful without surrounding context.

public OfficeLength? CharacterSpacing { get; set; } #

Gets or sets explicit additional physical character spacing. Values are stored in hundredths of a point; null removes the override.

public string Text { get; set; } #

Text content of the run. A line break in the assigned text continues the run with a:br and a further run per line; this instance keeps formatting all of those lines. A dynamic field holds one line, so its breaks become spaces.

public bool Bold { get; set; } #

Gets or sets a value indicating whether the run is bold.

public bool Italic { get; set; } #

Gets or sets a value indicating whether the run is italic.

public bool Underline { get; set; } #

Gets or sets a value indicating whether the run is underlined.

public PowerPointUnderlineStyle? UnderlineStyle { get; set; } #

Gets or sets the native DrawingML underline variant.

public bool Strikethrough { get; set; } #

Gets or sets a value indicating whether the run is strikethrough.

public PowerPointStrikeStyle? StrikeStyle { get; set; } #

Gets or sets the native DrawingML strike-through variant.

public PowerPointCapitalization? Capitalization { get; set; } #

Gets or sets native DrawingML capitalization without changing the stored characters.

public double? BaselinePercent { get; set; } #

Gets or sets the DrawingML baseline shift in percent, from -100 through 100. Positive values create superscript and negative values create subscript.

public OfficeLength? FontSize { get; set; } #

Gets or sets the physical font size, preserving DrawingML hundredth-point precision. Null removes the override; sizes must be from 1 through 4000 points.

public string? FontFamily { get; set; } #

Gets or sets the font family (Latin).

public OfficeColor? Color { get; set; } #

Gets or sets the local text color, retaining native theme slots. Alpha below 255 is written as native DrawingML opacity. Explicit color also applies to hyperlinks in readers supporting the native text-color extension.

public OfficeColor? BackgroundColor { get; set; } #

Gets or sets the run background (DrawingML highlight) color. Alpha below 255 is written as native opacity.

public bool HyperlinkUsesTextColor { get; set; } #

Gets or sets whether the existing click hyperlink uses this run's explicit or inherited text color instead of the theme hyperlink color. Set the hyperlink before assigning this property.

Exceptions

  • InvalidOperationException – There is no click hyperlink to format.
public bool HasClickInteraction { get; } #

Whether this run has click interaction markup, including hyperlinks, actions, or sounds.

public bool HasMouseOverInteraction { get; } #

Whether this run has mouse-over interaction markup, including hyperlinks, actions, or sounds.

public string? ClickAction { get; } #

Gets the DrawingML click action URI, when one is authored.

public string? MouseOverAction { get; } #

Gets the DrawingML mouse-over action URI, when one is authored.

public bool ClickStopsSound { get; } #

Whether clicking this run stops the currently playing sound.

public bool MouseOverStopsSound { get; } #

Whether entering this run stops the currently playing sound.

public string? ClickSoundName { get; } #

Gets the sound name played when this text run is clicked.

public string? MouseOverSoundName { get; } #

Gets the sound name played when the pointer enters this text run.