Method AddEnvelope
AddEnvelope(WordDocument, DocumentPosition, EnvelopeLayout, IReadOnlyList<string>?, IReadOnlyList<string>?)
Adds an envelope at the start of the document, or replaces the envelope the document starts with.
public static DocumentEdit AddEnvelope(this WordDocument document, DocumentPosition at, EnvelopeLayout layout, IReadOnlyList<string>? delivery = null, IReadOnlyList<string>? returnAddress = null)
Parameters
documentWordDocumentThe letter.
atDocumentPositionThe caret: kept, unless it was in the envelope replaced (then the letter's start).
layoutEnvelopeLayoutThe envelope's size and positions.
deliveryIReadOnlyList<string>The delivery address, or null or empty for a merge envelope.
returnAddressIReadOnlyList<string>The return address, or null or empty for none.
Returns
- DocumentEdit
The edit.
Exceptions
- ArgumentNullException
documentorlayoutis null, or a line is.- ArgumentException
The position is not in the document; too many lines, or a line too long or holding a control character.