We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get Fields in word Document

Thread ID:





151120 Jan 30,2020 04:17 PM UTC Jan 31,2020 06:18 PM UTC ASP.NET Core - EJ 2 1
Tags: DocIO
Asked On January 30, 2020 04:17 PM UTC

How can I do to get fieldvalues of a word document.
I have try some script but nothing it are correctly.

example script:
WordDocument document = new WordDocument(@"C:\Temp\Template.docx", FormatType.Docx);
WField Fields = new WField(document);

var Value  = Fields.FieldValue;

If I use this code the value of the FieldValue and "" but if I open the structural information of the document and navigate:
The list of Fields appears.

Manikandan Ravichandran [Syncfusion]
Replied On January 31, 2020 06:18 PM UTC

Hi Francesco,

Thank you for contacting Syncfusion.

From the given details, we suspect that your requirement is get all the fields in the document and its field values. Based on this we have prepared the sample application which can be downloaded from the below link.

In this sample we have done the following things.
1. Load the template document.
2. Update the fields in the document in order to get field value.
2. Iterate each element in the word document
3. Find the fields alone in these elements
4. Add the fields along with the field values.
5. Close the document.

Note: Please find the input Word document in “wwwroot” folder of above sample location.

Please let us know if you have any other questions.

Manikandan Ravichandran


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon