Evert,
You will need a plain bookmark stdadv where you want the field to
appear. As you can never tell what your users will do, it is a bit
more complicated than just having the result of the first dropdown add
a new field. What if the user changes their mind and then changes it
again ;-)
Try this on exit from the dropdown named "tel04":
Sub optipointselekt()
Dim oFfld As FormFields
Dim oRng As Word.Range
Dim oDoc As Word.Document
Set oDoc = ActiveDocument
Set oFfld = oDoc.FormFields
Set oRng = oDoc.Bookmarks("stdadv").Range
oDoc.Unprotect
If oFfld("tel04").Result = "Tel04B" Then
If Not ActiveDocument.Bookmarks.Exists("soortoptipoint") = True Then
oFfld.Add Range:=oRng, Type:=wdFieldFormDropDown
With oRng.FormFields(1)
.Name = "soortoptipoint"
.Enabled = True
.OwnHelp = False
.HelpText = ""
.OwnStatus = False
.StatusText = ""
End With
With oFfld("soortoptipoint").DropDown.ListEntries
.Clear
.Add "Standard"
.Add "Advanced"
End With
oFfld("soortoptipoint").DropDown.Value = 1
End If
Else
If ActiveDocument.Bookmarks.Exists("soortoptipoint") = True Then
oFfld("soortoptipoint").Delete
End If
End If
ActiveDocument.Protect wdAllowOnlyFormFields, True
End Sub
I didn't extensively test, but if the second formfield already exists
then you either want to ignore adding it again or delete it if
depending on subsequent user actions.
> Hi all,
>
[quoted text clipped - 37 lines]
> End If
> End Sub
Evert - 12 Sep 2006 18:55 GMT
I now get an error requested member of the collection does not exists. I will
send you an email about it. Hope you don't mind that.....
> Evert,
>
[quoted text clipped - 85 lines]
> > End If
> > End Sub