Search
 
SCRIPT & CODE EXAMPLE
 

HTML

documentformat.openxml bold text

using (SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Open(filename, true))
{
    WorkbookPart workBookPart = spreadsheetDocument.WorkbookPart;

    WorkbookPart workbookPart = spreadsheetDocument.WorkbookPart;
    WorksheetPart worksheetPart = workbookPart.WorksheetParts.First();
    SheetData sheetData = worksheetPart.Worksheet.Elements<SheetData>().First();

    //create a row
    Row row1 = new Row() { RowIndex = 1U };

    //create a new inline string cell
    Cell cell = new Cell() { CellReference = "A1" };
    cell.DataType = CellValues.InlineString;

    //create a run for the bold text
    Run run1 = new Run();
    run1.Append(new Text("ABC"));
    //create runproperties and append a "Bold" to them
    RunProperties run1Properties = new RunProperties();
    run1Properties.Append(new Bold());
    //set the first runs RunProperties to the RunProperties containing the bold
    run1.RunProperties = run1Properties;

    //create a second run for the non-bod text
    Run run2 = new Run();
    run2.Append(new Text(Environment.NewLine + "XYZ") { Space = SpaceProcessingModeValues.Preserve });

    //create a new inline string and append both runs
    InlineString inlineString = new InlineString();
    inlineString.Append(run1);
    inlineString.Append(run2);

    //append the inlineString to the cell.
    cell.Append(inlineString);

    //append the cell to the row
    row1.Append(cell);

    sheetData.Append(row1);
}
Comment

PREVIOUS NEXT
Code Example
Html :: mobile screen ful width not get in html 5 
Html :: tailwind danger text 
Html :: Text with colour bold 
Html :: html details open default 
Html :: how to open an index.html file in flask 
Html :: input field html for date 
Html :: html card 
Html :: make js run at the end 
Html :: html checkboxfor is not visible 
Html :: html projects for beginners 
Html :: Best Carousel Slider For BootStrap HTML5 
Html :: in form right to left html 
Html :: what is attributes in html 
Html :: a column inside another column bootstrap html 
Html :: how to do anchor in jupyter notebook markdown 
Html :: 24 hour time input html 
Html :: coding a classic grid in html 
Html :: HTML tags - what are tags ? 
Html :: prevent form submission on enter key 
Html :: html table colgroup 
Html :: random number text in html 
Html :: how to start in html 
Html :: html ol vs ul 
Html :: ubuntu 17.04 vmware 
Html :: is jeremy ugly 
Html :: html front page 
Html :: how to delete an activity andriod 
Html :: Search CSV files for text 
Html :: html language 
Html :: basic steps convert design into html 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =