FieldOptions class

FieldOptions class

Represents options to control field handling in a document. To learn more, visit the Working with Fields documentation article.

Properties

NameDescription
bibliographyStylesProviderGets or sets a provider that returns a bibliography style for the FieldBibliography and FieldCitation fields.
builtInTemplatesPathsGets or sets paths of MS Word built-in templates.
comparisonExpressionEvaluatorGets or sets the field comparison expressions evaluator.
currentUserGets or sets the current user information.
customTocStyleSeparatorGets or sets custom style separator for the \t switch in FieldToc field.
defaultDocumentAuthorGets or sets default document author’s name. If author’s name is already specified in built-in document properties, this option is not considered.
fieldDatabaseProviderGets or sets a provider that returns a query result for the FieldDatabase field.
fieldIndexFormatGets or sets a FieldOptions.fieldIndexFormat that represents the formatting for the FieldIndex fields in the document.
fieldUpdateCultureProviderGets or sets a provider that returns a culture object specific for each particular field.
fieldUpdateCultureSourceSpecifies what culture to use to format the field result.
fieldUpdatingCallbackGets or sets IFieldUpdatingCallback implementation
fieldUpdatingProgressCallbackGets or sets IFieldUpdatingProgressCallback implementation.
fileNameGets or sets the file name of the document.
isBidiTextSupportedOnUpdateGets or sets the value indicating whether bidirectional text is fully supported during field update or not.
legacyNumberFormatGets or sets the value indicating whether legacy (early than AW 13.10) number format for fields is enabled or not.
resultFormatterAllows to control how the field result is formatted.
templateNameGets or sets the file name of the template used by the document.
toaCategoriesGets or sets the table of authorities categories.
useInvariantCultureNumberFormatGets or sets the value indicating that number format is parsed using invariant culture or not
userPromptRespondentGets or sets the respondent to user prompts during field update.

Examples

Shows how to specify the source of the culture used for date formatting during a field update or mail merge.

let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);

// Insert two merge fields with German locale.
builder.font.localeId = new CultureInfo("de-DE").LCID;
builder.insertField("MERGEFIELD Date1 \\@ \"dddd, d MMMM yyyy\"");
builder.write(" - ");
builder.insertField("MERGEFIELD Date2 \\@ \"dddd, d MMMM yyyy\"");

// Set the current culture to US English after preserving its original value in a variable.
CultureInfo currentCulture = Thread.currentThread.CurrentCulture;
Thread.currentThread.CurrentCulture = new CultureInfo("en-US");

// This merge will use the current thread's culture to format the date, US English.
doc.mailMerge.execute(new.at(] { "Date1" }, new object[) { new DateTime(2020, 1, 01) });

// Configure the next merge to source its culture value from the field code. The value of that culture will be German.
doc.fieldOptions.fieldUpdateCultureSource = aw.Fields.FieldUpdateCultureSource.FieldCode;
doc.mailMerge.execute(new.at(] { "Date2" }, new object[) { new DateTime(2020, 1, 01) });

// The first merge result contains a date formatted in English, while the second one is in German.
expect(doc.range.text.trim()).toEqual("Wednesday, 1 January 2020 - Mittwoch, 1 Januar 2020");

// Restore the thread's original culture.
Thread.currentThread.CurrentCulture = currentCulture;

See Also