Word.Alignment enum
表示文本的水平对齐方式。
注解
使用方
- Word.列表: setLevelAlignment
- Word.ListLevel: alignment
- Word.段落:对齐
- Word.段落格式: 对齐
- Word.表:alignment, horizontalAlignment
- Word.TableCell: horizontalAlignment
- Word.TableRow: horizontalAlignment
- Word.TableStyle: alignment
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/paragraph-properties.yaml
// Centers the last paragraph between the document margins.
await Word.run(async (context) => {
const lastParagraph: Word.Paragraph = context.document.body.paragraphs.getLast();
const alignment: Word.Alignment = Word.Alignment.centered;
lastParagraph.alignment = alignment;
await context.sync();
});
字段
| centered = "Centered" | 居中对齐。 |
| justified = "Justified" | 完全两端对齐。 |
| left = "Left" | 向左对齐。 |
| mixed = "Mixed" | 混合水平对齐。 |
| right = "Right" | 向右对齐。 |
| unknown = "Unknown" | 未知对齐方式。 |