S
Susan B. Quinn
I have a form template that has a drop down menu with six choices. I wanted
to via a macro to insert text at two bookmarks depending on which option they
choose from the menu.
At the moment it is dropping all the options in when I run the macro. How do
I link the two actions together so I only get the text I want.
This was the code I had so far:
Sub vcr_rank()
' Well Below Average option
ActiveDocument.Unprotect
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 2
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a weak"
.Bookmarks("VCR_decision").Range.Text = "need more time and assistance
when making"
End With
' Below Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 3
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a limited"
.Bookmarks("VCR_decision").Range.Text = "need more time and assistance
when making"
End With
' Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 4
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "an average"
.Bookmarks("VCR_decision").Range.Text = "be able to"
End With
' Above Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 5
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a strong"
.Bookmarks("VCR_decision").Range.Text = "have a strong ability to make"
End With
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub
to via a macro to insert text at two bookmarks depending on which option they
choose from the menu.
At the moment it is dropping all the options in when I run the macro. How do
I link the two actions together so I only get the text I want.
This was the code I had so far:
Sub vcr_rank()
' Well Below Average option
ActiveDocument.Unprotect
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 2
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a weak"
.Bookmarks("VCR_decision").Range.Text = "need more time and assistance
when making"
End With
' Below Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 3
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a limited"
.Bookmarks("VCR_decision").Range.Text = "need more time and assistance
when making"
End With
' Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 4
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "an average"
.Bookmarks("VCR_decision").Range.Text = "be able to"
End With
' Above Average option
If ActiveDocument.FormFields("VCR_ranking").Type = wdFieldFormDropDown Then
ActiveDocument.FormFields("VCR_ranking").DropDown.Value = 5
End If
With ActiveDocument
.Bookmarks("VCR_ability").Range.Text = "a strong"
.Bookmarks("VCR_decision").Range.Text = "have a strong ability to make"
End With
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True
End Sub