Field.Code (Word)

Returns a Range object that represents a field's code.

A field's code is everything that's enclosed by the field characters ({ }) including the leading space and trailing space characters. You can access a field's code without changing the view from field results.


Dim fieldLoop As Field 
 
For Each fieldLoop In ActiveDocument.Fields 
 MsgBox Chr(34) & fieldLoop.Code.Text & Chr(34) 
Next fieldLoop