result property
Field.result property
Gets or sets text that is between the field separator and field end.
get result(): string
Examples
Shows how to insert a field into a document using a field code.
let doc = new aw.Document();
let builder = new aw.DocumentBuilder(doc);
let field = builder.insertField("DATE \\@ \"dddd, MMMM dd, yyyy\"");
expect(field.type).toEqual(aw.Fields.FieldType.FieldDate);
expect(field.getFieldCode()).toEqual("DATE \\@ \"dddd, MMMM dd, yyyy\"");
// This overload of the InsertField method automatically updates inserted fields.
expect((Date.now() - Date.parse(field.result)) / 86400000).toBeLessThanOrEqual(1);
See Also
- module Aspose.Words
- class Field