Edit

Word.CharacterCase enum

Specifies the case of the text in the specified range.

Remarks

API set: WordApiDesktop 1.3

Used by

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/28-formatting/character-formatting-and-case-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 first paragraph's text to uppercase.");
});

Fields

fullWidth = "FullWidth"

Specifies full-width characters.

halfWidth = "HalfWidth"

Specifies half-width characters.

hiragana = "Hiragana"

Specifies Hiragana characters.

katakana = "Katakana"

Specifies Katakana characters.

lower = "Lower"

Specifies lowercase.

next = "Next"

Specifies the next case.

titleSentence = "TitleSentence"

Specifies title case for the sentence.

titleWord = "TitleWord"

Specifies title case for each word.

toggle = "Toggle"

Specifies toggle case.

upper = "Upper"

Specifies uppercase.