We iterate through each of the top level fields. For each field
we set the value of the field to be equal to the value of the
name.
string[] names = doc.Form.GetFieldNames();
foreach (string theName in names) {
var field = doc.Form[theName];
field.Value = field.Name;
}
Dim theNames As String() = doc.Form.GetFieldNames()
For Each theName As String In theNames
Dim theField As Field = doc.Form(theName)
theField.Value = theField.Name
Next