Emailing Form Fields/VB to convert drop downs and check boxes to t

C

C.A. Durney

I'm new to this whole VB thing, but I'm making it work. I have a Word form
with drop downs, check boxes and text fields, and at the botton is a command
button that emails the form to me. The problem is that the info in the drop
downs and check boxes appears as just a small square box. How can I convert
the chosen selection in each drop down and check box into text so that it
appears in the email body. What kind of statement/macro would I need to put
in the exit event to do this? All I want is an email with all of the
responses. Thanks.
 
D

Doug Robbins - Word MVP on news.microsoft.com

Running the following code with convert the text fields and the dropdown to
ordinary text with the text in place of the drop down being the item that
was selected when the code was run

Dim i as long
With ActiveDocument
For i = .Fields.Count to 1 step - 1
.Fields(i).Unlink
Next i
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
C

C.A. Durney

Thank you very much! I tried this code as a maco in the exit statement of a
test filed but got a run time error on the .Fields (i).Unlink section.
Should I put this code in the command button (email's the document to me)
code?

C.A.
 
C

C.A. Durney

BTW, I've discovered that by putting this code in the exit box on the drop
down properties, it converts the command button back to text as well,
removing the associated code. I guess your code below goes in the command
button macro. Thanks for helping; I'm starting to figure some of this stuff
out, a little at a time.

C.A.
 
D

Doug Robbins - Word MVP on news.microsoft.com

Are you using a macrobutton field as your "command button"? If so, the code
would need to be added to that macro and you may need to modify it so that
it treated the macrobutton field in a different way from the formfields.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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