Table of Contents

Method AddEnvelope

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

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

document WordDocument

The letter.

at DocumentPosition

The caret: kept, unless it was in the envelope replaced (then the letter's start).

layout EnvelopeLayout

The envelope's size and positions.

delivery IReadOnlyList<string>

The delivery address, or null or empty for a merge envelope.

returnAddress IReadOnlyList<string>

The return address, or null or empty for none.

Returns

DocumentEdit

The edit.

Exceptions

ArgumentNullException

document or layout is 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.