Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

WordFieldBuilder

OfficeIMO.Word

Namespace
OfficeIMO.Word
Assembly
OfficeIMO.Word
Source revision
0eef6a5756b9 with working tree changes

Provides a fluent builder for constructing field codes including nested fields.

Inheritance

Usage

Explore 11 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 7

Constructors

public WordFieldBuilder(WordFieldType fieldType) #

Initializes a new instance for the specified WordFieldType.

Parameters

fieldType OfficeIMO.Word.WordFieldType required

Methods

AddInstruction 2 overloads
public WordFieldBuilder AddInstruction(string instruction, bool quoted = false) #

Adds an instruction to the field code.

Parameters

instruction string required
Instruction to append.
quoted bool = false optional
When true, the instruction is wrapped in quotes.
public WordFieldBuilder AddInstruction(WordFieldBuilder field) #

Adds a nested field as an instruction.

Parameters

field OfficeIMO.Word.WordFieldBuilder required
Nested field builder.
public WordFieldBuilder AddSwitch(string value) #

Adds a switch to the field code.

Parameters

value string required
Switch string including leading backslash.
public string Build() #

Builds the string representation of the field code.

Returns

string
public WordFieldBuilder SetCustomFormat(string format) #

Sets a custom date or time format.

Parameters

format string required
Custom format string.
public WordFieldBuilder SetFormat(WordFieldFormat format) #

Applies a format switch to the field code.

Parameters

format OfficeIMO.Word.WordFieldFormat required
Format switch to apply.

Properties

public WordFieldFormat? Format { get; private set; } #

Gets or sets the format switch applied to the field.

public string CustomFormat { get; private set; } #

Gets or sets the custom date or time format.