Method AfterCharacter
AfterCharacter(WordDocument, DocumentPosition, TypingCorrectionOptions?)
The correction for a character just typed: the caret is right after it. A quote is corrected as it is typed; the other corrections when the space after a word is typed (punctuation is part of the word); a list starts on the space after its marker.
public static DocumentEdit AfterCharacter(this WordDocument document, DocumentPosition caret, TypingCorrectionOptions? options = null)
Parameters
documentWordDocumentThe document.
caretDocumentPositionThe caret, right after the character typed.
optionsTypingCorrectionOptionsThe corrections to make; null for all (Word's defaults).
Returns
- DocumentEdit
The edit: empty when nothing is corrected. Its After is where the caret goes.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The caret is not in the document.
AfterCharacter(WordDocument, DocumentPosition, TypingCorrectionOptions?, IList<TypingCorrection>?)
The correction for a character just typed, as AfterCharacter(WordDocument, DocumentPosition, TypingCorrectionOptions?),
adding what each correction did to made (Word's AutoCorrect Options button: undo it, stop it).
public static DocumentEdit AfterCharacter(this WordDocument document, DocumentPosition caret, TypingCorrectionOptions? options, IList<TypingCorrection>? made)
Parameters
documentWordDocumentThe document.
caretDocumentPositionThe caret, right after the character typed.
optionsTypingCorrectionOptionsThe corrections to make; null for all (Word's defaults).
madeIList<TypingCorrection>Where the corrections made are added, in the order made; null for none.
Returns
- DocumentEdit
The edit: empty when nothing is corrected.
Exceptions
- ArgumentNullException
documentis null.- ArgumentException
The caret is not in the document.