Method InsertGreetingLine
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
documentWordDocumentThe document that holds the position.
atDocumentPositionWhere the field goes.
switchesstringThe field's switches (DefaultGreetingLineSwitches 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.