Table of Contents

Method InsertGreetingLine

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

InsertGreetingLine(WordDocument, DocumentPosition, string?)

Inserts Word's Greeting Line (Phase 167): GREETINGLINE with «GreetingLine» as its result. One undo step.

public static DocumentEdit InsertGreetingLine(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 (DefaultGreetingLineSwitches 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.