Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:25:47+00:00 2026-06-12T11:25:47+00:00

How can I check if some fields in my word have errors? I have

  • 0

How can I check if some fields in my word have errors? I have a large document that contains many references to other chapters or images. When those chapters or images are missing in the document, the fields containing those references will display Error! Reference Source Not Found instead of the reference.

The problem is, that I need to create an algorithm that will check for those reference errors, no matter what the locale and language of the file is. The problem is, that this field error is localized in the language of the system of the user who uses the word.

How can I do this? Is there any property on Field that can be used to check if the source is available?

Currently, I check for errors in the fields by using the result text of the field:

Int32 fieldErrors = 0;
foreach (Word.Field field in doc.Fields)
{
    field.Update();
    if (field.Result.Text.StartsWith("Error!"))
        ++fieldErrors;
}

Unfortunately, this will only work in english word instances.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:25:48+00:00Added an answer on June 12, 2026 at 11:25 am

    In the documentation for Field types it is seen that a Field instance has an Update() method that returns a bool. The documentation does not state what the semantic meaning of the return value is, however, by doing a short empirical study I found that the method returns true if the Update() succeeded and false if the update did not succeed. This means that in order to find fields with errors you can do something like:

    var fieldsWithErrors = new List<Field>();
    foreach (Field field in document.Fields)
    {
        if(!field.Update())
            fieldsWithErrors.Add(field);
    }
    

    … or shorter with LINQ:

    var fieldsWithErrors = document.Fields.Cast<Field>().Where(field => !field.Update()).ToList();
    

    Another (and faster) approach would be to use the Update() method exposed by the Fields collection.

    var indexOfFirstError = document.Fields.Update();
    

    … the method returns the index of the first field with an error. If no errors are found, the method returns 0.

    For complete documentation please see the MSDN references:

    • Field.Update()
    • Fields.Update()
    • Field members
    • Fields members
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a check box list in that user can check or uncheck the
I have some form fields that when a form is submitted creates an array
How can I achieve that an user could only edit some fields from a
Just wanted to write some recursion but can't check if the child is in
I am running some tests with linq, how can I check what queries SQL
How can I describe RSpec test to check if the array doesn't include some
I know that I can check whether the linux timestamp in $time is today
I'm looking for an algorithm that can check if nested regex repeats are reducible.
Have a form that is emailed with checkboxes. Some checkboxes have an optional field
I have a JSP with some fields. When I fill in the fields and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.