Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

PowerPointTextBox

OfficeIMO.PowerPoint

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

Represents a textbox shape.

Inheritance

Usage

Explore 38 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 38

Methods

public PowerPointParagraph AddBullet(string text) #

Adds a new bulleted paragraph to the textbox.

Parameters

text string required
public IReadOnlyList<PowerPointParagraph> AddBullets(IEnumerable<string> bullets, int level = 0, char bulletChar = '•', Action<PowerPointParagraph>? configure = null) #

Adds a bulleted list to the textbox.

Parameters

bullets System.Collections.Generic.IEnumerable<string> required
level int = 0 optional
bulletChar char = '•' optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public IReadOnlyList<PowerPointParagraph> AddMarkdown(string markdown) #

Appends rich text parsed from a small Markdown subset to the textbox.

Parameters

markdown string required

Returns

IReadOnlyList<PowerPointParagraph>
AddNumberedItem 2 overloads
public PowerPointParagraph AddNumberedItem(string text, PowerPointNumberingScheme style, int startAt = 1) #

Adds a numbered item to the textbox.

Parameters

text string required
style OfficeIMO.PowerPoint.PowerPointNumberingScheme required
startAt int = 1 optional
public PowerPointParagraph AddNumberedItem(string text, int startAt = 1) #

Adds a numbered item to the textbox using the default numbering style.

Parameters

text string required
startAt int = 1 optional
AddNumberedList 2 overloads
public IReadOnlyList<PowerPointParagraph> AddNumberedList(IEnumerable<string> items, PowerPointNumberingScheme style, int startAt = 1, int level = 0, Action<PowerPointParagraph>? configure = null) #

Adds a numbered list to the textbox.

Parameters

items System.Collections.Generic.IEnumerable<string> required
style OfficeIMO.PowerPoint.PowerPointNumberingScheme required
startAt int = 1 optional
level int = 0 optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public IReadOnlyList<PowerPointParagraph> AddNumberedList(IEnumerable<string> items, int startAt = 1, int level = 0, Action<PowerPointParagraph>? configure = null) #

Adds a numbered list to the textbox using the default numbering style.

Parameters

items System.Collections.Generic.IEnumerable<string> required
startAt int = 1 optional
level int = 0 optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public PowerPointParagraph AddParagraph(string text = "", Action<PowerPointParagraph>? configure = null, Action<PowerPointTextRun>? run = null) #

Adds a paragraph to the textbox.

Parameters

text string = "" optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional
run System.Action<OfficeIMO.PowerPoint.PowerPointTextRun>? = null optional
public IReadOnlyList<PowerPointParagraph> AddParagraphs(IEnumerable<string> paragraphs, Action<PowerPointParagraph>? configure = null) #

Adds multiple paragraphs to the textbox.

Parameters

paragraphs System.Collections.Generic.IEnumerable<string> required
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public PowerPointTextBox ApplyAutoSpacing(double lineSpacingMultiplier = 1.2, OfficeLength? spaceBefore = null, OfficeLength? spaceAfter = null) #

Applies automatic spacing defaults to the textbox paragraphs.

Parameters

lineSpacingMultiplier double = 1.2 optional
spaceBefore OfficeIMO.OfficeLength? = null optional
spaceAfter OfficeIMO.OfficeLength? = null optional
public PowerPointTextBox ApplyParagraphStyle(PowerPointParagraphStyle style) #

Applies a paragraph style to the textbox.

Parameters

style OfficeIMO.PowerPoint.PowerPointParagraphStyle required
public PowerPointTextBox ApplyTextStyle(PowerPointTextStyle style, bool applyToRuns = false) #

Applies a text style to the textbox.

Parameters

style OfficeIMO.PowerPoint.PowerPointTextStyle required
applyToRuns bool = false optional
public void Clear() #

Removes all paragraphs from the textbox.

public int ReplaceAll(string text, string replacement, OfficeTextSearchOptions? options = null) #

Replaces literal text in the textbox paragraphs.

Parameters

text string required
Text to find.
replacement string required
Replacement text; null removes each match.
options OfficeIMO.OfficeTextSearchOptions? = null optional
Comparison settings. null matches ordinally, ignoring case, inside or across words.

Returns

int The number of replaced matches.
public PowerPointTextBox SetBold(bool bold = true) #

Sets PowerPointTextBox.Bold for the entire text box and returns this instance.

Parameters

bold bool = true optional
public IReadOnlyList<PowerPointParagraph> SetBullets(IEnumerable<string> bullets, int level = 0, char bulletChar = '•', Action<PowerPointParagraph>? configure = null) #

Replaces all paragraphs with a bulleted list.

Parameters

bullets System.Collections.Generic.IEnumerable<string> required
level int = 0 optional
bulletChar char = '•' optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public PowerPointTextBox SetColor(OfficeColor? color) #

Sets PowerPointTextBox.Color for the entire text box and returns this instance.

Parameters

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

Sets PowerPointTextBox.FontFamily for the entire text box and returns this instance.

Parameters

fontFamily string? required
public PowerPointTextBox SetFontSize(OfficeLength? fontSize) #

Sets PowerPointTextBox.FontSize for the entire text box and returns this instance.

Parameters

fontSize OfficeIMO.OfficeLength? required
public PowerPointTextBox SetItalic(bool italic = true) #

Sets PowerPointTextBox.Italic for the entire text box and returns this instance.

Parameters

italic bool = true optional
public IReadOnlyList<PowerPointParagraph> SetMarkdown(string markdown) #

Replaces the textbox content with rich text parsed from a small Markdown subset.

Parameters

markdown string required

Returns

IReadOnlyList<PowerPointParagraph>
SetNumberedList 2 overloads
public IReadOnlyList<PowerPointParagraph> SetNumberedList(IEnumerable<string> items, PowerPointNumberingScheme style, int startAt = 1, int level = 0, Action<PowerPointParagraph>? configure = null) #

Replaces all paragraphs with a numbered list.

Parameters

items System.Collections.Generic.IEnumerable<string> required
style OfficeIMO.PowerPoint.PowerPointNumberingScheme required
startAt int = 1 optional
level int = 0 optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public IReadOnlyList<PowerPointParagraph> SetNumberedList(IEnumerable<string> items, int startAt = 1, int level = 0, Action<PowerPointParagraph>? configure = null) #

Replaces all paragraphs with a numbered list using the default numbering style.

Parameters

items System.Collections.Generic.IEnumerable<string> required
startAt int = 1 optional
level int = 0 optional
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public IReadOnlyList<PowerPointParagraph> SetParagraphs(IEnumerable<string> paragraphs, Action<PowerPointParagraph>? configure = null) #

Replaces all paragraphs with the provided content.

Parameters

paragraphs System.Collections.Generic.IEnumerable<string> required
configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null optional

Returns

IReadOnlyList<PowerPointParagraph>
public PowerPointTextBox SetTextAutoFit(PowerPointTextAutoFit fit, PowerPointTextAutoFitOptions? options = null) #

Sets the auto-fit mode and optional Normal auto-fit options.

Parameters

fit OfficeIMO.PowerPoint.PowerPointTextAutoFit required
options OfficeIMO.PowerPoint.PowerPointTextAutoFitOptions? = null optional
public PowerPointTextBox SetTextMargins(OfficeLength left, OfficeLength top, OfficeLength right, OfficeLength bottom) #

Sets all text margins as a physical length.

Parameters

left OfficeIMO.OfficeLength required
top OfficeIMO.OfficeLength required
right OfficeIMO.OfficeLength required
bottom OfficeIMO.OfficeLength required

Properties

public OfficePresetShapeType? ShapeType { get; } #

Gets the preset geometry used by this text-bearing shape.

public bool UsesTextBoxGeometry { get; } #

Gets whether this shape represents a conventional text box or placeholder rather than a text-bearing preset shape.

public IReadOnlyList<PowerPointParagraph> Paragraphs { get; } #

Paragraphs contained in the textbox.

public string Text { get; set; } #

Text contained in the textbox.

public bool IsPlaceholder { get; } #

Returns true if the textbox is tied to a slide placeholder.

public PowerPointPlaceholderType? PlaceholderType { get; set; } #

Gets or sets the placeholder type for this textbox.

public uint? PlaceholderIndex { get; set; } #

Gets or sets the placeholder index for this textbox.

public PowerPointPlaceholderSize? PlaceholderSize { get; set; } #

Gets or sets the preferred placeholder size.

public PowerPointPlaceholderDirection? PlaceholderOrientation { get; set; } #

Gets or sets the placeholder orientation.

public OfficeLength? TextMarginLeft { get; set; } #

Gets or sets the left text margin as a physical length.

public OfficeLength? TextMarginRight { get; set; } #

Gets or sets the right text margin as a physical length.

public OfficeLength? TextMarginTop { get; set; } #

Gets or sets the top text margin as a physical length.

public OfficeLength? TextMarginBottom { get; set; } #

Gets or sets the bottom text margin as a physical length.

public PowerPointTextVerticalAlignment? TextVerticalAlignment { get; set; } #

Gets or sets the vertical anchoring of text inside the textbox.

public PowerPointTextDirection? TextDirection { get; set; } #

Gets or sets the text direction (horizontal/vertical).

public PowerPointTextAutoFit? TextAutoFit { get; set; } #

Gets or sets the text auto-fit behavior.

public PowerPointTextAutoFitOptions? TextAutoFitOptions { get; set; } #

Gets or sets detailed auto-fit options (only applies to Normal auto-fit).

public bool Bold { get; set; } #

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

public bool Italic { get; set; } #

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

public OfficeLength? FontSize { get; set; } #

Gets or sets the font size as a physical length.

public string? FontFamily { get; set; } #

Gets or sets the font family.

public OfficeColor? Color { get; set; } #

Gets the first run's RGB text color or sets the color of every run. Alpha below 255 is written as native opacity.