Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Mar 21, 2024 9:24 am

Is it possible to read form fields in word with Spire.doc? We have form fields that store information in the StatusText and HelpText and would have to read and process them with Spire.doc, but there is no possibility, is there?

hammes_it
 
Posts: 13
Joined: Wed Nov 13, 2019 11:47 am

Thu Mar 21, 2024 10:09 am

Hello,

Thanks for your inquriy.
Our Spire supports retrieving the content of form fields based on their names. Please refer to the following code snippet for testing. If there are any misunderstandings, please provide us with your word file and we will further investigate. Thank you in advance.
Code: Select all
 Document document = new Document(@"FillFormField.doc");
 Spire.Doc.Section section = document.Sections[0];
 FormField formField = section.Body.FormFields["fiedName"];
 string text = formField.Text;


Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 203
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc