Get Started
Documentation

SetWrap

SetWrap(isWrap)

Specifies whether the words in the cell must be wrapped to fit the cell size or not.

Parameters:

Name Type Description
isWrap boolean When set to true the words in the cell will be wrapped to fit the cell size.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetValue("This is the text to show SetWrap");
oWorksheet.GetRange("A2").SetWrap(true);
oWorksheet.GetRange("C2").SetValue("This is the text to show no wrap");
oWorksheet.GetRange("C2").SetWrap(false);
builder.SaveFile("xlsx", "SetWrap.xlsx");
builder.CloseFile();

Resulting document