Syncfusion.XlsIO.Base
Example 


WrapText Property (IExtendedFormat)

True - Text is wrapped at right border.
Syntax
'Declaration
 
Property WrapText As Boolean
'Usage
 
Dim instance As IExtendedFormat
Dim value As Boolean
 
instance.WrapText = value
 
value = instance.WrapText
bool WrapText {get; set;}
Remarks
To know more about text wrapping refer Apply Wrap Text.
Example
The following code illustrates how to set WrapText property.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set text
            worksheet["C2"].Text = "This is a Sample text";
            worksheet["C5"].Text = "This is a Sample text";
            
            //Add style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set wrap text
            style.WrapText = true;
            
            //Set style
            worksheet["C2"].CellStyle = style;
            
            //Get extended format
            IExtendedFormat format = worksheet["C5"].CellStyle;
            
            //Set wrap text
            format.WrapText = true;
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also