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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top