Method InsertAddressBlock
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
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere the field goes.
switchesstringThe field's switches (DefaultAddressBlockSwitches when null), at most 1,024 characters.
Returns
- DocumentEdit
The edit; After is just past the field.
Exceptions
- ArgumentNullException
documentis 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.