Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

RtfRun

OfficeIMO.Rtf

Namespace
OfficeIMO.Rtf
Assembly
OfficeIMO.Rtf
Source revision
ba882f6b0d07 with working tree changes
Implements
IRtfCloneable IRtfInline
Modifiers
sealed

Text run with character-level formatting.

Inheritance

  • object
  • RtfRun

Usage

Explore 43 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 1

Methods

public RtfRun ClearRevision() #

Clears tracked revision metadata from the run.

Returns

RtfRun
public RtfRun SetBaseline() #

Resets the run to normal baseline text.

Returns

RtfRun
public RtfRun SetBold(bool value = true) #

Enables bold formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetCapsStyle(RtfCapsStyle capsStyle) #

Sets the run capitalization effect.

Parameters

capsStyle OfficeIMO.Rtf.RtfCapsStyle required

Returns

RtfRun
public RtfRun SetCharacterBackgroundColor(int? colorIndex) #

Sets character background shading to a one-based color table index.

Parameters

colorIndex int? required

Returns

RtfRun
public RtfRun SetCharacterBorder(RtfParagraphBorderStyle style, int? width = null, int? colorIndex = null) #

Sets the character border formatting.

Parameters

style OfficeIMO.Rtf.RtfParagraphBorderStyle required
width int? = null optional
colorIndex int? = null optional

Returns

RtfRun
public RtfRun SetCharacterOffsetHalfPoints(int halfPoints) #

Sets signed baseline offset in half-points.

Parameters

halfPoints int required

Returns

RtfRun
public RtfRun SetCharacterScale(int percent) #

Sets character scale percentage.

Parameters

percent int required

Returns

RtfRun
public RtfRun SetCharacterShading(int? backgroundColorIndex, int? foregroundColorIndex = null, int? patternPercent = null, RtfShadingPattern pattern = None) #

Sets character shading color and pattern metadata.

Parameters

backgroundColorIndex int? required
foregroundColorIndex int? = null optional
patternPercent int? = null optional
pattern OfficeIMO.Rtf.RtfShadingPattern = None optional

Returns

RtfRun
public RtfRun SetCharacterSpacingTwips(int spacingTwips) #

Sets character spacing in twips.

Parameters

spacingTwips int required

Returns

RtfRun
public RtfRun SetDeletedRevision(int? authorIndex = null, int? timestampValue = null) #

Marks the run as tracked deleted text.

Parameters

authorIndex int? = null optional
timestampValue int? = null optional

Returns

RtfRun
public RtfRun SetDirection(RtfTextDirection? direction) #

Sets explicit run text direction.

Parameters

direction OfficeIMO.Rtf.RtfTextDirection? required

Returns

RtfRun
public RtfRun SetDoubleStrikethrough(bool value = true) #

Enables double strike-through formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetEmboss(bool value = true) #

Enables embossed text formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetFontSize(double points) #

Sets the run font size in points.

Parameters

points double required

Returns

RtfRun
public RtfRun SetForegroundColor(int colorIndex) #

Sets the foreground color table index.

Parameters

colorIndex int required

Returns

RtfRun
public RtfRun SetHidden(bool value = true) #

Enables hidden text formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetHighlightColor(int colorIndex) #

Sets the highlight color table index.

Parameters

colorIndex int required

Returns

RtfRun
public RtfRun SetImprint(bool value = true) #

Enables engraved/imprinted text formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetInsertedRevision(int? authorIndex = null, int? timestampValue = null) #

Marks the run as tracked inserted text.

Parameters

authorIndex int? = null optional
timestampValue int? = null optional

Returns

RtfRun
public RtfRun SetItalic(bool value = true) #

Enables italic formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetKerningHalfPoints(int halfPoints) #

Sets the kerning threshold in half-points.

Parameters

halfPoints int required

Returns

RtfRun
public RtfRun SetLanguage(int languageId) #

Sets the run language LCID.

Parameters

languageId int required

Returns

RtfRun
public RtfRun SetNote(RtfNote note) #

Attaches a footnote or annotation to this run.

Parameters

note OfficeIMO.Rtf.RtfNote required

Returns

RtfRun
public RtfRun SetOutline(bool value = true) #

Enables outline text formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetRevisionSaveIds(int? character = null, int? insertion = null, int? deletion = null) #

Sets run-level revision save identifiers.

Parameters

character int? = null optional
insertion int? = null optional
deletion int? = null optional

Returns

RtfRun
public RtfRun SetShadow(bool value = true) #

Enables shadow text formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetStrikethrough(bool value = true) #

Enables strike-through formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetStyle(int styleId) #

Sets the character style id.

Parameters

styleId int required

Returns

RtfRun
public RtfRun SetSubscript() #

Marks the run as subscript text.

Returns

RtfRun
public RtfRun SetSuperscript() #

Marks the run as superscript text.

Returns

RtfRun
SetUnderline 2 overloads
public RtfRun SetUnderline(bool value = true) #

Enables underline formatting.

Parameters

value bool = true optional

Returns

RtfRun
public RtfRun SetUnderline(RtfUnderlineStyle style) #

Sets underline formatting to the requested RTF underline style.

Parameters

style OfficeIMO.Rtf.RtfUnderlineStyle required

Returns

RtfRun
public RtfRun SetUnderlineColor(int colorIndex) #

Sets the underline color table index.

Parameters

colorIndex int required

Returns

RtfRun
public RtfRun TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #

Changes the stored run text casing while preserving character formatting.

Parameters

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

Returns

RtfRun

Properties

public string Text { get; set; } #

Run text.

public bool UseDefaultCharacterFormatting { get; set; } #

Whether a native plain reset selects document defaults beneath this run's direct and character-style formatting.

public bool Bold { get; set; } #

Whether the run is bold.

public bool? DirectBold { get; set; } #

Authored Bold override. Null inherits from the selected style; an explicit default clears that style value.

public bool Italic { get; set; } #

Whether the run is italic.

public bool? DirectItalic { get; set; } #

Authored Italic override. Null inherits from the selected style; an explicit default clears that style value.

public bool Underline { get; set; } #

Whether the run is underlined. Setting this property uses single underline when enabled.

public RtfUnderlineStyle UnderlineStyle { get; set; } #

Underline style for the run.

public RtfUnderlineStyle? DirectUnderlineStyle { get; set; } #

Authored UnderlineStyle override. Null inherits from the selected style; an explicit default clears that style value.

public bool Strikethrough { get; set; } #

Whether the run is struck through.

public bool DoubleStrikethrough { get; set; } #

Whether the run uses double strikethrough.

public bool Hidden { get; set; } #

Whether the run is hidden text.

public bool? DirectHidden { get; set; } #

Authored hidden-text override. Null inherits; false makes text visible beneath a hidden-text style.

public bool Outline { get; set; } #

Whether the run text is outlined.

public bool Shadow { get; set; } #

Whether the run text has a shadow effect.

public bool Emboss { get; set; } #

Whether the run text is embossed.

public bool Imprint { get; set; } #

Whether the run text is engraved/imprinted.

public RtfCapsStyle CapsStyle { get; set; } #

Optional all-caps or small-caps character effect.

public RtfVerticalPosition VerticalPosition { get; set; } #

Optional superscript or subscript positioning.

public double? FontSize { get; set; } #

Optional font size in points.

public int? FontId { get; set; } #

Optional font id.

public int? ForegroundColorIndex { get; set; } #

Optional foreground color index.

public int? HighlightColorIndex { get; set; } #

Optional background highlight color index.

public int? CharacterBackgroundColorIndex { get; set; } #

One-based color table index used by character background shading.

public int? CharacterShadingForegroundColorIndex { get; set; } #

One-based color table index used by character pattern foreground shading.

public int? CharacterShadingPatternPercent { get; set; } #

Raw RTF \chshdng value, where 10000 represents 100 percent.

public RtfShadingPattern CharacterShadingPattern { get; set; } #

Named RTF character shading pattern.

public RtfCharacterBorder CharacterBorder { get; private set; } #

Character border metadata represented by \chbrdr and following border controls.

public int? UnderlineColorIndex { get; set; } #

Optional underline color table index. A null value uses the document default.

public int? CharacterSpacingTwips { get; set; } #

Optional character spacing in twips. Positive values expand text and negative values condense it.

public int? CharacterScalePercent { get; set; } #

Optional character scale percentage. A null value uses the document default of 100 percent.

public int? KerningHalfPoints { get; set; } #

Optional kerning threshold in half-points.

public int? CharacterOffsetHalfPoints { get; set; } #

Optional signed baseline offset in half-points. Positive values raise text and negative values lower it.

public int? StyleId { get; set; } #

Optional character stylesheet id.

public RtfTextDirection? Direction { get; set; } #

Explicit run text direction represented by \ltrch or \rtlch.

public int? LanguageId { get; set; } #

Optional run language LCID represented by \lang.

public RtfNote? Note { get; set; } #

Optional footnote or annotation emitted immediately after this run.

public RtfRevisionKind RevisionKind { get; set; } #

Optional tracked revision marker for this run.

public int? RevisionAuthorIndex { get; set; } #

Optional zero-based index into the document revision author table.

public int? RevisionTimestampValue { get; set; } #

Optional raw RTF DTTM revision timestamp value from \revdttm.

public int? CharacterRevisionSaveId { get; set; } #

Character revision save identifier represented by \charrsid.

public int? InsertionRevisionSaveId { get; set; } #

Insertion revision save identifier represented by \insrsid.

public int? DeletionRevisionSaveId { get; set; } #

Deletion revision save identifier represented by \delrsid.