GetAllParagraphs

GetAllParagraphs() → { Array.<ApiParagraph> }

Returns an array of all paragraphs from the current document content.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiParagraph>

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Paragraph 1");
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Paragraph 2");
oDocument.AddElement(1, oParagraph);
var aParagraphs = oDocument.GetAllParagraphs();
aParagraphs[0].SetBold(true);
builder.SaveFile("docx", "GetAllParagraphs.docx");
builder.CloseFile();

Resulting document