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
Used by
- Excel.CellPropertiesFormat: horizontalAlignment
- Excel.RangeFormat: horizontalAlignment
- Excel.Style: horizontalAlignment
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" |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
