Get Started
Documentation

Last

Last() → { ParagraphContent }

Get the last no empty element of the paragraph.

Returns:

Type
ParagraphContent

Example

Copy code
builder.CreateFile("docx");
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oRun_1 = Api.CreateRun();
oRun_1.AddText("This is an Run with text. ");
oParagraph.Push(oRun_1);
oRun_2 = Api.CreateRun();
oRun_2.AddText("And this is the last Run in the paragraph.");
oParagraph.Push(oRun_2);
oLastRun = oParagraph.Last();
oLastRun.SetBold(true);
builder.SaveFile("docx", "Last.docx");
builder.CloseFile();