E
Evert
Hi all,
I am totaly new at this scripting and searched many of your already problems
but could not find a solution for my question so here it is....
In my form (Word 2003) I have a bookmark with a certain value (which is
determined by a dropdown box choosen value). This bookmark has a value TEL04A
or TEL04B. When the value is TEL04B then I would like to have a dropdown box
created and visible to the filler of the form but if it is TEL04A the box may
not be shown at all.
I tried this with the scripting below which does not give any error but also
does not give me a dropdown box.
So.... the question here is: what is wrong with the scripting or what am I
not doing correctly?
Thx
Evert
Sub optipointselekt()
If ActiveDocument.Bookmarks("tel04") = "TEL04B" Then
ActiveDocument.Bookmarks("stdadv").Select
Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "soortoptipoint"
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
End With
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Clear
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Add Name:= _
"Standard"
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Add Name:= _
"Advanced"
End If
End Sub
I am totaly new at this scripting and searched many of your already problems
but could not find a solution for my question so here it is....
In my form (Word 2003) I have a bookmark with a certain value (which is
determined by a dropdown box choosen value). This bookmark has a value TEL04A
or TEL04B. When the value is TEL04B then I would like to have a dropdown box
created and visible to the filler of the form but if it is TEL04A the box may
not be shown at all.
I tried this with the scripting below which does not give any error but also
does not give me a dropdown box.
So.... the question here is: what is wrong with the scripting or what am I
not doing correctly?
Thx
Evert
Sub optipointselekt()
If ActiveDocument.Bookmarks("tel04") = "TEL04B" Then
ActiveDocument.Bookmarks("stdadv").Select
Selection.FormFields.Add Range:=Selection.Range, Type:=wdFieldFormDropDown
Selection.PreviousField.Select
With Selection.FormFields(1)
.Name = "soortoptipoint"
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
End With
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Clear
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Add Name:= _
"Standard"
Selection.FormFields("soortoptipoint").DropDown.ListEntries.Add Name:= _
"Advanced"
End If
End Sub