cubbycub
11-26-2009, 04:01 AM
Hello I was wondering if someone could help me. Im reasonably new to VBA with some playing about with Excel macros but this is my first attempt with Word.
Im Useing Word2007 on a PC
We have a holiday request form, on that form i have a table, within that table i have a dropdown that we use to selct empoyee names. this is then just printed off and handed to the HR dep.
We now have a change in policy whereby the employee needs to hand the request in to their respective line manager.
I would like to automate this with a simple email button that sends the form attached as an email to the right person.
Im right at the start of this project and ive fallen down at the first hurdle. Im getting an error "the requested member of the collection does not exist"
Private Sub CommandButton1_Click()
Select Case ActiveDocument.FormFields("Dropdown1").DropDown.Value
Case "WhoEver"
Stop
Case Else
End Select
End Sub
Im suspecting that i cant have the dropdown in a table is this right?
or
Is "Dropdown1" a specific reference name that i have to change.
In short I dont know how to reference inputs to the form basically. Any help or pointing me in the right direction would be very appreciated.
Im Useing Word2007 on a PC
We have a holiday request form, on that form i have a table, within that table i have a dropdown that we use to selct empoyee names. this is then just printed off and handed to the HR dep.
We now have a change in policy whereby the employee needs to hand the request in to their respective line manager.
I would like to automate this with a simple email button that sends the form attached as an email to the right person.
Im right at the start of this project and ive fallen down at the first hurdle. Im getting an error "the requested member of the collection does not exist"
Private Sub CommandButton1_Click()
Select Case ActiveDocument.FormFields("Dropdown1").DropDown.Value
Case "WhoEver"
Stop
Case Else
End Select
End Sub
Im suspecting that i cant have the dropdown in a table is this right?
or
Is "Dropdown1" a specific reference name that i have to change.
In short I dont know how to reference inputs to the form basically. Any help or pointing me in the right direction would be very appreciated.