Word.CharacterCase enum
为指定范围内的文字指定大小写。
注解
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/35-ranges/format-range-text-desktop.yaml
// Converts the first paragraph's text to uppercase.
await Word.run(async (context) => {
const paragraphRange: Word.Range = context.document.body.paragraphs.getFirst().getRange(Word.RangeLocation.content);
const characterCase: Word.CharacterCase = Word.CharacterCase.upper;
paragraphRange.case = characterCase;
await context.sync();
console.log("Converted the text to uppercase.");
});
字段
| fullWidth = "FullWidth" | 指定全角字符。 |
| halfWidth = "HalfWidth" | 指定半角字符。 |
| hiragana = "Hiragana" | 指定平假名字符。 |
| katakana = "Katakana" | 指定片假名字符。 |
| lower = "Lower" | 指定小写。 |
| next = "Next" | 指定下一个案例。 |
| titleSentence = "TitleSentence" | 指定句子的标题大小写。 |
| titleWord = "TitleWord" | 指定每个单词的标题大小写。 |
| toggle = "Toggle" | 指定切换大小写。 |
| upper = "Upper" | 指定大写字母。 |