NativeExcel for .Net Developer's Reference

IRange.WrapText Property

Gets or sets a value that indicates whether the text are wrapped.

[Visual Basic]

Property Value

true if the text are wrapped; otherwise, false. Microsoft Excel will change the row height of the range, if necessary, to accommodate the text in the range.


This example formats cell B2 on sheet one so that the text wraps within the cell.

 IRange r = book.Worksheets[1].Range["B2"]; 
 r.WrapText = true;
 r.Value = "This text should wrap in a cell";
 Dim r As IRange = book.Worksheets(1).Range("B2")
 r.WrapText = True
 r.Value = "This text should wrap in a cell"
 IRange* r = book->Worksheets->Item[1]->Range->Item[S"B2"]; 
 r->WrapText = true;
 r->Value = S"This text should wrap in a cell";

See Also

IRange Interface | NativeExcel Namespace