EliseFreedman
Programmer
Hi There
I am trying to save the values entered into my Word Form into variables so that I can include the variables within an email. I am using the code below
However when the code gets to FormName = Selection.FormFields(EmployeeName).Result it is coming up with an error saying the requested member of the collection does not exist.
Does anyone know what I am doing wrong? I think part of the problem might be that when I go to fill in the form field, the form will only let me type to the left of the shaded in form field so I basically end up with [xxxxshaded part] where xxx is the text im typing. Once I type the text, the name of the bookmark disappears. I suspect I need to get it so that the text being typed goes into the shaded part but Im not sure how to do this. Can anyone help.
I am trying to save the values entered into my Word Form into variables so that I can include the variables within an email. I am using the code below
Code:
Dim FrmName As String
Dim FrmClockNo As String
Dim FrmTelNo As String
Dim FrmDept As String
FormName = Selection.FormFields(EmployeeName).Result
FormClockNo = Selection.FormFields(ClockNo).Result
FormTelNo = Selection.FormFields(TelNo).Result
FormDept = Selection.FormFields(Dept).Result
End Sub
However when the code gets to FormName = Selection.FormFields(EmployeeName).Result it is coming up with an error saying the requested member of the collection does not exist.
Does anyone know what I am doing wrong? I think part of the problem might be that when I go to fill in the form field, the form will only let me type to the left of the shaded in form field so I basically end up with [xxxxshaded part] where xxx is the text im typing. Once I type the text, the name of the bookmark disappears. I suspect I need to get it so that the text being typed goes into the shaded part but Im not sure how to do this. Can anyone help.