Table of Contents

Method AfterCharacter

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

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

document WordDocument

The document.

caret DocumentPosition

The caret, right after the character typed.

options TypingCorrectionOptions

The 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

document is 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

document WordDocument

The document.

caret DocumentPosition

The caret, right after the character typed.

options TypingCorrectionOptions

The corrections to make; null for all (Word's defaults).

made IList<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

document is null.

ArgumentException

The caret is not in the document.