Expand description
Text editing on a TextBody: positions are (paragraph, character offset). Inserting text
with \n splits paragraphs; formatting a range splits runs at its ends.
Functions§
- change_
case - Change case:
upper,lower,sentence,title,toggle. - char_
move - One character left/right across paragraph boundaries.
- delete
- Delete the range between
aandb; returns the caret at the start. - delete_
word - Delete a word from
posas Ctrl+Backspace (forward == false) or Ctrl+Delete does in PowerPoint; returns the caret. - end
- End of the body.
- format
- Apply
fto the run properties of every run in [a, b). An empty range changes the empty paragraph’s end mark (so typing there picks the formatting up). - format_
all - Apply
fto every run in the body (and end marks). - insert
- Insert
textatpos(withprops, else the props atpos).\nstarts a new paragraph (same level and paragraph props);\u{b}inserts a line break. Returns the caret after it. - insert_
body - Insert a formatted body at
pos(paste): first paragraph merges into the current one. - next_
case - The case Shift+F3 changes
sto next, as PowerPoint cycles it: lowercase → Capitalize Each Word → UPPERCASE → lowercase; any other mix goes to UPPERCASE first. - para_
down - Ctrl+Down: the start of the next paragraph, or the end of the last one.
- para_up
- Ctrl+Up: the start of the paragraph, or of the previous one when already there.
- props_
at - The explicit run properties in effect at
pos(the run before the caret, or the end mark). - slice
- A formatted copy of the range.
- text_
range - The text between two positions (
\nbetween paragraphs). - word_at
- The word a double-click selects around
pos(seewords::word_at): the word without its trailing spaces, as PowerPoint selects it. - word_
move - Next/previous word stop (Ctrl+Right/Left on Windows, Option+arrows on the Mac). At the end of a paragraph Ctrl+Right goes to the start of the next one; at its start Ctrl+Left goes to the end of the previous one.
Type Aliases§
- Pos
- (paragraph, char offset in the paragraph).