FieldDisplayResult Property |
Gets the text that represents the displayed field result.
Syntax
public string DisplayResult { get; }
Public ReadOnly Property DisplayResult As String
Get
public:
property String^ DisplayResult {
String^ get ();
}
member DisplayResult : string with get
Property Value
Type:
String
Remarks
Examples
Shows how to get the real text that a field displays in the document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("This document was written by ");
FieldAuthor fieldAuthor = (FieldAuthor)builder.InsertField(FieldType.FieldAuthor, true);
fieldAuthor.AuthorName = "John Doe";
Assert.AreEqual(string.Empty, fieldAuthor.DisplayResult);
fieldAuthor.Update();
Assert.AreEqual("John Doe", fieldAuthor.DisplayResult);
doc.Save(ArtifactsDir + "Field.DisplayResult.docx");
See Also