selective copying/pasting of forms

N

Newuser

Hi:
I am creating a document which will ask users to select a phrase from a
dropdown menu. The user will also need to be able to add that phrase to a
summary section if he/she chooses to (maybe by selecting a checkbox); if the
box is
checked the phrase will be copied if not the phrase will only be in the
dropdown.
I have been able to copy and paste the selected phrase to the Summary
section of my doculment automatically by placing a REF field in the summary
section that points to the dropdown, however I cannot figure out how to allow
the user to decide if they want to add it or not.
 
G

Graham Mayor

I assume that this is a protected form?
Add a checkbox field (Check1)
Run on exit from a dropdown field (Dropdown1) the following macro will
insert (or not) the content of the dropdown field in a form field (Text1)
according to the setting of the check box field (Check1). Put the form field
(Text1) in your summary.
Rename the fields to suit your requirements:

Sub OnExitDD1()
Dim oFld As FormFields
Dim sRes As String
Set oFld = ActiveDocument.FormFields
If oFld("Check1").Result = True Then
sRes = oFld("DropDown1").Result
Else
sRes = ""
End If
oFld("Text1").Result = sRes
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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