1
votes

I'm new to VBA and I can't find a solution to my problem. I use a Word Form with a dropdown menu. The options in this dropdown menu are names. I want Word to automatically fill in 3 other (regular) Formfields (with contact details) when I chose a name in the dropdown menu. Basically, I want what is explained here (see link), but without use of Microsoft Access:

http://www.techrepublic.com/blog/how-do-i/how-do-i-dynamically-fill-microsoft-word-fields-using-access-data/

1

1 Answers

1
votes

After 2 weeks of learning VBA the solution seems so simple. Here's it if anybody needs to accomplish the same. Feel free to use it!

If ActiveDocument.*name of dropdown field* = "contact person 1" Then
    ActiveDocument.FormFields("formfield1").Result = "xxx"
    ActiveDocument.FormFields("formfield2").Result = "xxx"
    ActiveDocument.FormFields("formfield3").Result = "xxx"
ElseIf ActiveDocument.*name of dropdown field* = "contact person 2" Then
    ActiveDocument.FormFields("formfield1").Result = "xxx"
    ActiveDocument.FormFields("formfield2").Result = "xxx"
    ActiveDocument.FormFields("formfield3").Result = "xxx"
ElseIf ActiveDocument.*name of dropdown field* = "contact person 3" Then

...etc

End If