PowerPointTextRun
OfficeIMO.PowerPoint
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.
Returned or exposed by 18
- Method PowerPointParagraph.AddFormattedText
- Method PowerPointParagraph.AddText
- Property PowerPointParagraph.Runs
- Property PowerPointParagraphInline.Run
- Method PowerPointTableCell.AddText
- Property PowerPointTableCell.Runs
- Method PowerPointTextRun.SetBackgroundColor
- Method PowerPointTextRun.SetBaseline
- Method PowerPointTextRun.SetBold
- Method PowerPointTextRun.SetColor
- Method PowerPointTextRun.SetFontFamily
- Method PowerPointTextRun.SetFontSize
- Method PowerPointTextRun.SetItalic
- Method PowerPointTextRun.SetStrikethrough
- Method PowerPointTextRun.SetSubscript
- Method PowerPointTextRun.SetSuperscript
- Method PowerPointTextRun.SetUnderline
- Method PowerPointTextRun.TransformTextCase
Accepted by parameters 4
- Method PowerPointParagraph.AddField
- Method PowerPointTableCell.AddParagraph
- Method PowerPointTextBox.AddParagraph
- Method PowerPointTextStyle.Apply
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
Returns
PowerPointTextRunpublic PowerPointTextRun SetBaseline() #Restores the run to the normal text baseline.
Returns
PowerPointTextRunpublic PowerPointTextRun SetBold(bool isBold = true) #Sets PowerPointTextRun.Bold and returns this run.
Parameters
- isBold bool = true
Returns
PowerPointTextRunpublic 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
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetClickStopsSound(bool value) #Controls whether clicking this text run stops the currently playing sound.
Parameters
- value bool
public PowerPointTextRun SetColor(OfficeColor color) #Sets PowerPointTextRun.Color and returns this run.
Parameters
- color OfficeIMO.OfficeColor
Returns
PowerPointTextRunpublic PowerPointTextRun SetFontFamily(string fontFamily) #Sets PowerPointTextRun.FontFamily and returns this run.
Parameters
- fontFamily string
Returns
PowerPointTextRunpublic PowerPointTextRun SetFontSize(OfficeLength size) #Sets PowerPointTextRun.FontSize and returns this run.
Parameters
- size OfficeIMO.OfficeLength
Returns
PowerPointTextRunpublic void SetHyperlink(string url, string? tooltip = null) #Sets a hyperlink for this run.
Parameters
- url string
- tooltip string? = null
public void SetHyperlink(Uri uri, string? tooltip = null) #Sets a hyperlink for this run.
Parameters
- uri System.Uri
- tooltip string? = null
public void SetHyperlink(PowerPointSlide targetSlide, string? tooltip = null) #Sets an internal hyperlink from this run to another slide in the same presentation.
Parameters
- targetSlide OfficeIMO.PowerPoint.PowerPointSlide
- tooltip string? = null
public PowerPointTextRun SetItalic(bool isItalic = true) #Sets PowerPointTextRun.Italic and returns this run.
Parameters
- isItalic bool = true
Returns
PowerPointTextRunpublic 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
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetMouseOverStopsSound(bool value) #Controls whether entering this text run stops the currently playing sound.
Parameters
- value bool
public PowerPointTextRun SetStrikethrough(bool strikethrough = true) #Sets PowerPointTextRun.Strikethrough and returns this run.
Parameters
- strikethrough bool = true
Returns
PowerPointTextRunpublic PowerPointTextRun SetSubscript(double baselinePercent = 25) #Applies subscript using a 25 percent baseline shift.
Parameters
- baselinePercent double = 25
Returns
PowerPointTextRunpublic PowerPointTextRun SetSuperscript(double baselinePercent = 30) #Applies superscript using a 30 percent baseline shift.
Parameters
- baselinePercent double = 30
Returns
PowerPointTextRunpublic PowerPointTextRun SetUnderline(bool underline = true) #Sets PowerPointTextRun.Underline and returns this run.
Parameters
- underline bool = true
Returns
PowerPointTextRunpublic PowerPointTextRun TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #Changes the stored run text casing while preserving run formatting.
Parameters
- textCase OfficeIMO.Drawing.OfficeTextCase
- culture System.Globalization.CultureInfo? = null
Returns
PowerPointTextRunInherited Methods
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 Uri? Hyperlink { get; set; } #Gets or sets the hyperlink target for this run. Internal slide links are returned as stable Markdown-compatible fragments such as #slide-2.
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.