Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Excel.HorizontalAlignment enum

Package:
excel

Remarks

API set: ExcelApi 1.1

Used by

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/42-range/range-merged-ranges.yaml

await Excel.run(async (context) => {
 // Retrieve the worksheet and the table in that worksheet.
 const sheet = context.workbook.worksheets.getActiveWorksheet();
 const tableRange = sheet.getRange("B2:E6");

 // Create a merged range in the first row of the table.
 const chartTitle = tableRange.getRow(0);
 chartTitle.merge(true);

 // Format the merged range.
 chartTitle.format.horizontalAlignment = "Center";

 await context.sync();
});

Fields

center = "Center"
centerAcrossSelection = "CenterAcrossSelection"
distributed = "Distributed"
fill = "Fill"
general = "General"
justify = "Justify"
left = "Left"
right = "Right"

Feedback

Was this page helpful?