drop down form fields

D

DJ

I am working with Word 2003 documents that contain form fields with drop
downs. A value is selected, but when I save the document as Text with
Layout, the value dissappears. Any ideas on how to retain the value via a
macro?
 
J

Jean-Guy Marcil

DJ was telling us:
DJ nous racontait que :
I am working with Word 2003 documents that contain form fields with
drop downs. A value is selected, but when I save the document as Text
with Layout, the value dissappears. Any ideas on how to retain the
value via a macro?

Try this:

'_______________________________________
Sub ConvertFieldsToText()

Dim myField As FormField
Dim FieldRange As Range
Dim FieldValue As String

With ActiveDocument
If Not .ProtectionType = wdNoProtection Then
.Unprotect
End If

For Each myField In .FormFields
With myField
FieldValue = .Result
.Range.Text = FieldValue
End With
Next
End With

End Sub
'_______________________________________


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top