Get Started
Usage API
More information

GetText

GetText() → { string }

Returns the paragraph text.

Parameters:

This method doesn't have any parameters.

Returns:

Type
string

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("This is just a sample text.");
var sText = oParagraph.GetText();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("The text of the first paragraph: " + sText);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "GetText.docx");
builder.CloseFile();

Resulting document