Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Fields property in Microsoft.Office.Interop.Word.Document refers to what?

I have seen code like this in C#
C#
Microsoft.Office.Interop.Word.Document Doc;
Doc.Fields.Update();


What does it update in word document? Words, texts, paragraphs....?
Posted
Updated 7-Mar-17 0:58am
Comments
Richard MacCutchan 30-Nov-15 9:58am    
Why not read the documentation to find out?

1 solution

https://msdn.microsoft.com/en-us/library/microsoft.office.tools.word.document.fields.aspx[^]

Fields are from building forms, manually or such as the mail merge.
 
Share this answer
 
Comments
yash35 30-Nov-15 15:31pm    
So Ryan, Doc.Fields.Update() does this line updates the mail merge fields? With what values?
ZurdoDev 30-Nov-15 15:36pm    
What values? From the mail merge. Are you familiar with mail merge?
ZurdoDev 30-Nov-15 15:57pm    
It updates fields. I suggest you may want to read the help file on what fields are. There are different kinds.
yash35 30-Nov-15 15:58pm    
Ok.. Thanks Ryan...
ZurdoDev 30-Nov-15 16:04pm    
Sure.

For example, a real simple one is today's date. You can put a field on a word doc that is a formula. So, if you call Fields.Update() then that field will be updated to the current value of the formula.

It may make sense realizing that most form fields are some sort of formula so it's just updating them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900