TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

Select

Select() → { boolean }

Selects the current run.

Parameters:

This method doesn't have any parameters.

Returns:

Type
boolean

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oRun = Api.CreateRun();
oRun.AddText("This is just a sample text.");
oParagraph.AddElement(oRun);
oRun.Select();
oParagraph.AddLineBreak();
oParagraph.AddText("The text from the first run was selected.");
builder.SaveFile("docx", "Select.docx");
builder.CloseFile();

Resulting document