Selective Copy/paste of a dropdown selection

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. I use word 2002.

Thank you in advance
 
G

Greg Maxey

Run a macro similiar to the following on exit from the dropdown and the
checkbox:

Sub PasteSelection()
Dim oDoc As Word.Document
Dim oFF As FormFields
Dim oRng As Word.Range
Set oDoc = ActiveDocument
Set oFF = oDoc.FormFields
Set oRng = oDoc.Bookmarks("IP").Range 'IP is the bookmark name where the
selection should be duplicated.
oDoc.Unprotect
If oFF("Check1").CheckBox.Value = True Then
oRng.Text = oFF("Dropdown1").Result
ActiveDocument.Bookmarks.Add "IP", oRng
Else
oRng.Text = ""
ActiveDocument.Bookmarks.Add "IP", oRng
End If
oDoc.Protect wdAllowOnlyFormFields, True
End Sub
 
G

Graham Mayor

It didn't save me any work! Similar response posted in the other forum to
which you posted. Please do not multi-post!!!!

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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