PowerPointTextBox
OfficeIMO.PowerPoint
Represents a textbox shape.
Inheritance
- PowerPointShape
- PowerPointTextBox
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
- Method PowerPointDocument.EnsureLayoutDateTimePlaceholderTextBox
- Method PowerPointDocument.EnsureLayoutFooterPlaceholderTextBox
- Method PowerPointDocument.EnsureLayoutHeaderFooterPlaceholders
- Method PowerPointDocument.EnsureLayoutPlaceholderTextBox
- Method PowerPointDocument.EnsureLayoutSlideNumberPlaceholderTextBox
- Method PowerPointDocument.GetLayoutPlaceholderTextBox
- Method PowerPointMasterSurface.AddPlaceholder
- Method PowerPointMasterSurface.AddTextBox
- Method PowerPointMasterSurface.GetPlaceholder
- Property PowerPointMasterSurface.Placeholders
- Method PowerPointSlide.AddTextBox
- Method PowerPointSlide.AddTextShape
- Method PowerPointSlide.AddTextToPlaceholder
- Method PowerPointSlide.AddTitle
- Method PowerPointSlide.GetGroupTextBoxes
- Method PowerPointSlide.GetPlaceholder
- Method PowerPointSlide.GetTextBox
- Property PowerPointSlide.Placeholders
- Property PowerPointSlide.TextBoxes
- Method PowerPointSlideCompositionContext.AddTextBlock
- Method PowerPointSlideLayout.AddPlaceholder
- Method PowerPointSlideLayout.AddTextBox
- Method PowerPointSlideLayout.GetPlaceholder
- Property PowerPointSlideLayout.Placeholders
- Method PowerPointSlideMaster.AddPlaceholder
- Method PowerPointSlideMaster.AddTextBox
- Method PowerPointSlideMaster.GetPlaceholder
- Property PowerPointSlideMaster.Placeholders
- Method PowerPointTextBox.ApplyAutoSpacing
- Method PowerPointTextBox.ApplyParagraphStyle
- Method PowerPointTextBox.ApplyTextStyle
- Method PowerPointTextBox.SetBold
- Method PowerPointTextBox.SetColor
- Method PowerPointTextBox.SetFontFamily
- Method PowerPointTextBox.SetFontSize
- Method PowerPointTextBox.SetItalic
- Method PowerPointTextBox.SetTextAutoFit
- Method PowerPointTextBox.SetTextMargins
Methods
public PowerPointParagraph AddBullet(string text) #Adds a new bulleted paragraph to the textbox.
Parameters
- text string
Returns
PowerPointParagraphpublic 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>
- level int = 0
- bulletChar char = '•'
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
Returns
IReadOnlyList<PowerPointParagraph>public IReadOnlyList<PowerPointParagraph> AddMarkdown(string markdown) #Appends rich text parsed from a small Markdown subset to the textbox.
Parameters
- markdown string
Returns
IReadOnlyList<PowerPointParagraph>public PowerPointParagraph AddNumberedItem(string text, PowerPointNumberingScheme style, int startAt = 1) #Adds a numbered item to the textbox.
Parameters
- text string
- style OfficeIMO.PowerPoint.PowerPointNumberingScheme
- startAt int = 1
Returns
PowerPointParagraphpublic PowerPointParagraph AddNumberedItem(string text, int startAt = 1) #Adds a numbered item to the textbox using the default numbering style.
Parameters
- text string
- startAt int = 1
Returns
PowerPointParagraphpublic 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>
- style OfficeIMO.PowerPoint.PowerPointNumberingScheme
- startAt int = 1
- level int = 0
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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>
- startAt int = 1
- level int = 0
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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 = ""
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
- run System.Action<OfficeIMO.PowerPoint.PowerPointTextRun>? = null
Returns
PowerPointParagraphpublic IReadOnlyList<PowerPointParagraph> AddParagraphs(IEnumerable<string> paragraphs, Action<PowerPointParagraph>? configure = null) #Adds multiple paragraphs to the textbox.
Parameters
- paragraphs System.Collections.Generic.IEnumerable<string>
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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
- spaceBefore OfficeIMO.OfficeLength? = null
- spaceAfter OfficeIMO.OfficeLength? = null
Returns
PowerPointTextBoxpublic PowerPointTextBox ApplyParagraphStyle(PowerPointParagraphStyle style) #Applies a paragraph style to the textbox.
Parameters
- style OfficeIMO.PowerPoint.PowerPointParagraphStyle
Returns
PowerPointTextBoxpublic PowerPointTextBox ApplyTextStyle(PowerPointTextStyle style, bool applyToRuns = false) #Applies a text style to the textbox.
Parameters
- style OfficeIMO.PowerPoint.PowerPointTextStyle
- applyToRuns bool = false
Returns
PowerPointTextBoxpublic int ReplaceAll(string text, string replacement, OfficeTextSearchOptions? options = null) #Replaces literal text in the textbox paragraphs.
Parameters
- text string
- Text to find.
- replacement string
- Replacement text; null removes each match.
- options OfficeIMO.OfficeTextSearchOptions? = null
- 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
Returns
PowerPointTextBoxpublic 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>
- level int = 0
- bulletChar char = '•'
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
Returns
IReadOnlyList<PowerPointParagraph>public PowerPointTextBox SetColor(OfficeColor? color) #Sets PowerPointTextBox.Color for the entire text box and returns this instance.
Parameters
- color OfficeIMO.OfficeColor?
Returns
PowerPointTextBoxpublic PowerPointTextBox SetFontFamily(string? fontFamily) #Sets PowerPointTextBox.FontFamily for the entire text box and returns this instance.
Parameters
- fontFamily string?
Returns
PowerPointTextBoxpublic PowerPointTextBox SetFontSize(OfficeLength? fontSize) #Sets PowerPointTextBox.FontSize for the entire text box and returns this instance.
Parameters
- fontSize OfficeIMO.OfficeLength?
Returns
PowerPointTextBoxpublic PowerPointTextBox SetItalic(bool italic = true) #Sets PowerPointTextBox.Italic for the entire text box and returns this instance.
Parameters
- italic bool = true
Returns
PowerPointTextBoxpublic IReadOnlyList<PowerPointParagraph> SetMarkdown(string markdown) #Replaces the textbox content with rich text parsed from a small Markdown subset.
Parameters
- markdown string
Returns
IReadOnlyList<PowerPointParagraph>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>
- style OfficeIMO.PowerPoint.PowerPointNumberingScheme
- startAt int = 1
- level int = 0
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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>
- startAt int = 1
- level int = 0
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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>
- configure System.Action<OfficeIMO.PowerPoint.PowerPointParagraph>? = null
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
- options OfficeIMO.PowerPoint.PowerPointTextAutoFitOptions? = null
Returns
PowerPointTextBoxpublic PowerPointTextBox SetTextMargins(OfficeLength left, OfficeLength top, OfficeLength right, OfficeLength bottom) #Sets all text margins as a physical length.
Parameters
- left OfficeIMO.OfficeLength
- top OfficeIMO.OfficeLength
- right OfficeIMO.OfficeLength
- bottom OfficeIMO.OfficeLength
Returns
PowerPointTextBoxInherited Methods
public PowerPointShape BindToPlaceholder(PowerPointPlaceholderType placeholderType, uint? index = null) #Parameters
- placeholderType PowerPointPlaceholderType
- index uint? = null
Returns
PowerPointShapepublic PowerPointShape Duplicate(OfficeLength offsetX = default, OfficeLength offsetY = default) #Parameters
- offsetX OfficeLength = default
- offsetY OfficeLength = default
Returns
PowerPointShapepublic PowerPointShape MoveBy(OfficeLength offsetX, OfficeLength offsetY) #Parameters
- offsetX OfficeLength
- offsetY OfficeLength
Returns
PowerPointShapepublic PowerPointShape Resize(OfficeLength width, OfficeLength height, PowerPointShapeAnchor anchor = TopLeft) #Parameters
- width OfficeLength
- height OfficeLength
- anchor PowerPointShapeAnchor = TopLeft
Returns
PowerPointShapepublic PowerPointShape Scale(double scale, PowerPointShapeAnchor anchor = Center) #Parameters
- scale double
- anchor PowerPointShapeAnchor = Center
Returns
PowerPointShapepublic PowerPointShape Scale(double scaleX, double scaleY, PowerPointShapeAnchor anchor = Center) #Parameters
- scaleX double
- scaleY double
- anchor PowerPointShapeAnchor = Center
Returns
PowerPointShapepublic void SetBlur(OfficeLength radius, bool grow = false) #Parameters
- radius OfficeLength
- grow bool = false
public void SetClickSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Parameters
- audio Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public void SetGlow(OfficeColor color, OfficeLength? radius = null, int transparencyPercent = 30) #Parameters
- color OfficeColor
- radius OfficeLength? = null
- transparencyPercent int = 30
public void SetHyperlink(Uri uri, string? tooltip = null) #Parameters
- uri Uri
- tooltip string? = null
public void SetHyperlink(PowerPointSlide targetSlide, string? tooltip = null) #Parameters
- targetSlide PowerPointSlide
- tooltip string? = null
public PowerPointShape SetLanguage(string language) #Parameters
- language string
Returns
PowerPointShapepublic void SetLineEnds(OfficeLineMarkerKind? startType, OfficeLineMarkerKind? endType, PowerPointLineEndWidth? width = null, PowerPointLineEndLength? length = null) #Parameters
- startType OfficeLineMarkerKind?
- endType OfficeLineMarkerKind?
- width PowerPointLineEndWidth? = null
- length PowerPointLineEndLength? = null
public void SetMouseOverSound(Stream audio, string name, string contentType = "audio/wav", string extension = ".wav") #Parameters
- audio Stream
- name string
- contentType string = "audio/wav"
- extension string = ".wav"
public PowerPointShape SetPosition(OfficeLength left, OfficeLength top) #Parameters
- left OfficeLength
- top OfficeLength
Returns
PowerPointShapepublic void SetReflection(OfficeLength? blur = null, OfficeLength? distance = null, double directionDegrees = 270, double fadeDirectionDegrees = 90, int startOpacityPercent = 50, int endOpacityPercent = 0, int startPositionPercent = 0, int endPositionPercent = 100, PowerPointRectangleAlignment? alignment = null, bool rotateWithShape = false) #Parameters
- blur OfficeLength? = null
- distance OfficeLength? = null
- directionDegrees double = 270
- fadeDirectionDegrees double = 90
- startOpacityPercent int = 50
- endOpacityPercent int = 0
- startPositionPercent int = 0
- endPositionPercent int = 100
- alignment PowerPointRectangleAlignment? = null
- rotateWithShape bool = false
public void SetShadow(OfficeColor color, OfficeLength? blur = null, OfficeLength? distance = null, double angleDegrees = 45, int transparencyPercent = 35, bool rotateWithShape = false) #Parameters
- color OfficeColor
- blur OfficeLength? = null
- distance OfficeLength? = null
- angleDegrees double = 45
- transparencyPercent int = 35
- rotateWithShape bool = false
public PowerPointShape SetSize(OfficeLength width, OfficeLength height) #Parameters
- width OfficeLength
- height OfficeLength
Returns
PowerPointShapepublic void SetSoftEdges(OfficeLength radius) #Parameters
- radius OfficeLength
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 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 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.
Inherited Properties
public string? Title { get; set; } #public bool Decorative { get; set; } #public IReadOnlyList<string> Languages { get; } #public OfficeColor? FillColor { get; set; } #public int? FillTransparency { get; set; } #public double? Rotation { get; set; } #public bool? HorizontalFlip { get; set; } #public bool? VerticalFlip { get; set; } #public PowerPointPlaceholderType? ShapePlaceholderType { get; } #public PowerPointPlaceholderSize? ShapePlaceholderSize { get; } #public PowerPointPlaceholderDirection? ShapePlaceholderOrientation { get; } #public PowerPointShapeContentType ShapeContentType { get; } #public OfficeLength Width { get; set; } #public OfficeLength Height { get; set; } #public IReadOnlyList<PowerPointConnectionSite> ConnectionSites { get; } #public OfficeLength Right { get; set; } #public OfficeLength Bottom { get; set; } #public OfficeLength CenterX { get; set; } #public OfficeLength CenterY { get; set; } #public PowerPointLayoutBox Bounds { get; set; } #public OfficeColor? OutlineColor { get; set; } #public int? OutlineTransparency { get; set; } #public OfficeLength? OutlineWidth { get; set; } #public PowerPointLineDashStyle? OutlineDash { get; set; } #public string? MouseOverSoundName { get; } #