Table of Contents

Method InsertAddressBlock

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

InsertAddressBlock(WordDocument, DocumentPosition, string?)

Inserts Word's Address Block (Phase 167): ADDRESSBLOCK with «AddressBlock» as its result, as Mailings

Address Block writes it. One undo step.

public static DocumentEdit InsertAddressBlock(this WordDocument document, DocumentPosition at, string? switches = null)

Parameters

document WordDocument

The document that holds the position.

at DocumentPosition

Where the field goes.

switches string

The field's switches (DefaultAddressBlockSwitches when null), at most 1,024 characters.

Returns

DocumentEdit

The edit; After is just past the field.

Exceptions

ArgumentNullException

document is null.

ArgumentException

The position is not in the document, or the switches are too long.

InvalidOperationException

The position is in a shape's text box or inside content a reader synthesized.