Class representing a small text block called 'run'.
Name | Description |
AddColumnBreak | Adds a column break to the current run position and starts the next element from a new column. |
AddComment | Adds a comment to the current run.
|
AddDrawing | Adds a drawing object (image, shape or chart) to the current text run. |
AddHyperlink | Adds a hyperlink to the current run. |
AddLineBreak | Adds a line break to the current run position and starts the next element from a new line. |
AddPageBreak | Adds a page break and starts the next element from a new page. |
AddTabStop | Adds a tab stop to the current run. |
AddText | Adds some text to the current run. |
ClearContent | Clears the content from the current run. |
Copy | Creates a copy of the current run. |
Delete | Deletes the current run. |
GetBold | Gets the bold property from the current text properties. |
GetCaps | Specifies whether the text with the current text properties are capitalized. |
GetClassType | Returns a type of the ApiRun class. |
GetColor | Gets the RGB color from the current text properties. |
GetDoubleStrikeout | Gets the double strikeout property from the current text properties. |
GetFontFamily | Gets the font family from the current text properties. |
GetFontNames | Returns all font names from all elements inside the current run. |
GetFontSize | Gets the font size from the current text properties. |
GetHighlight | Gets the highlight property from the current text properties. |
GetItalic | Gets the italic property from the current text properties. |
GetLanguage | Gets the language from the current text properties. |
GetParentContentControl | Returns a content control that contains the current run. |
GetParentTable | Returns a table that contains the current run. |
GetParentTableCell | Returns a table cell that contains the current run. |
GetPosition | Gets the text position from the current text properties measured in half-points (1/144 of an inch). |
GetRange | Returns a Range object that represents the part of the document contained in the specified run. |
GetShd | Gets the text shading from the current text properties. |
GetSmallCaps | Specifies whether the text with the current text properties are displayed capitalized two points smaller than the actual font size. |
GetSpacing | Gets the text spacing from the current text properties measured in twentieths of a point. |
GetStrikeout | Gets the strikeout property from the current text properties. |
GetStyle | Gets the style of the current text properties. |
GetText | Returns a text from the text run. |
GetTextPr | Returns the text properties of the current run. |
GetUnderline | Gets the underline property from the current text properties. |
GetVertAlign | Gets the vertical alignment type from the current text properties. |
RemoveAllElements | Removes all the elements from the current run. |
Select | Selects the current run. |
SetBold | Sets the bold property to the text character. |
SetCaps | Specifies that any lowercase characters in the current text run are formatted for display only as their capital letter character equivalents. |
SetColor | Sets the text color for the current text run in the RGB format. |
SetDoubleStrikeout | Specifies that the contents of the current run are displayed with two horizontal lines through each character displayed on the line. |
SetFontFamily | Sets all 4 font slots with the specified font family. |
SetFontSize | Sets the font size to the characters of the current text run. |
SetHighlight | Specifies a highlighting color which is applied as a background to the contents of the current run. |
SetItalic | Sets the italic property to the text character. |
SetLanguage | Specifies the languages which will be used to check spelling and grammar (if requested) when processing the contents of this text run. |
SetPosition | Specifies an amount by which text is raised or lowered for this run in relation to the default baseline of the surrounding non-positioned text. |
SetShd | Specifies the shading applied to the contents of the current text run. |
SetSmallCaps | Specifies that all the small letter characters in this text run are formatted for display only as their capital letter character equivalents which are two points smaller than the actual font size specified for this text. |
SetSpacing | Sets the text spacing measured in twentieths of a point. |
SetStrikeout | Specifies that the contents of the current run are displayed with a single horizontal line through the center of the line. |
SetStyle | Sets a style to the current run. |
SetTextPr | Sets the text properties to the current run. |
SetUnderline | Specifies that the contents of the current run are displayed along with a line appearing directly below the character (less than all the spacing above and below the characters on the line). |
SetVertAlign | Specifies the alignment which will be applied to the contents of the current run in relation to the default appearance of the text run:
|
ToJSON | Converts the ApiRun object into the JSON object. |
WrapInMailMergeField | Wraps a run in a mail merge field. |
builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oParagraph = oDocument.GetElement(0); var oRun = Api.CreateRun(); oRun.AddText("This is just a sample text."); oRun.AddLineBreak(); oRun.AddTabStop(); oRun.AddTabStop(); oRun.AddText(" Nothing special."); oRun.SetBold(true); oParagraph.AddElement(oRun); var oCopyRun = oRun.Copy(); oParagraph.AddLineBreak(); oParagraph.AddElement(oCopyRun); oRun = Api.CreateRun(); var oDrawing = Api.CreateChart("bar3D", [ [200, 240, 280], [250, 260, 280] ], ["Projected Revenue", "Estimated Costs"], [2014, 2015, 2016], 4051300, 2347595, 24); var oFill = Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51)); oDrawing.SetSeriesFill(oFill, 0, false); oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61)); oDrawing.SetSeriesFill(oFill, 1, false); oDrawing.SetVerAxisTitle("USD In Hundred Thousands", 10); oDrawing.SetHorAxisTitle("Year", 11); oDrawing.SetLegendPos("bottom"); oDrawing.SetShowDataLabels(false, false, true, false); oDrawing.SetTitle("Financial Overview", 13); oRun.AddDrawing(oDrawing); oParagraph.AddElement(oRun); oRun = Api.CreateRun(); oRun.AddText("onlyoffice document builder"); oRun.SetCaps(true); oParagraph.AddLineBreak(); oParagraph.AddElement(oRun); oRun.AddHyperlink("https://www.onlyoffice.com", "main page"); builder.SaveFile("docx", "ApiRun.docx"); builder.CloseFile();